RTI Connext DDS Micro  Version 2.4.11
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
MyUdpTransform

UDP Transform Example. More...

Data Structures

struct  MyUdpTransformFactory
 The UDP Transformation factory class. More...
struct  MyUdpTransform
 The custom UDP transformation class. More...

Functions

RTI_PRIVATE struct MyUdpTransformMyUdpTransform_create (struct MyUdpTransformFactory *factory, const struct UDP_TransformProperty *const property)
 Method to create an instance of MyUdpTransform.
RTI_PRIVATE void MyUdpTransform_delete (struct MyUdpTransform *t)
 Method to delete an instance of MyUdpTransform.
RTI_PRIVATE RTI_BOOL MyUdpTransform_create_destination_transform (UDP_Transform_T *const udptf, void **const context, const struct NETIO_Address *const destination, const struct NETIO_Netmask *const netmask, void *user_data, const struct UDP_TransformProperty *const property, RTI_INT32 *const ec)
 Method to create a transformation for an destination address.
RTI_PRIVATE RTI_BOOL MyUdpTransform_delete_destination_transform (UDP_Transform_T *const udptf, void *context, const struct NETIO_Address *const destination, const struct NETIO_Netmask *const netmask, RTI_INT32 *const ec)
 Method to delete a transformation for an destination address.
RTI_PRIVATE RTI_BOOL MyUdpTransform_create_source_transform (UDP_Transform_T *const udptf, void **const context, const struct NETIO_Address *const source, const struct NETIO_Netmask *const netmask, void *user_data, const struct UDP_TransformProperty *const property, RTI_INT32 *const ec)
 Method to create a transformation for an source address.
RTI_PRIVATE RTI_BOOL MyUdpTransform_delete_source_transform (UDP_Transform_T *const udptf, void *context, const struct NETIO_Address *const source, const struct NETIO_Netmask *const netmask, RTI_INT32 *const ec)
 Method to delete a transformation for an source address.
RTI_PRIVATE RTI_BOOL MyUdpTransform_transform_source (UDP_Transform_T *const udptf, void *context, const struct NETIO_Address *const source, const NETIO_Packet_T *const in_packet, NETIO_Packet_T **out_packet, RTI_INT32 *const ec)
 Method to transform data based on a source address.
RTI_PRIVATE RTI_BOOL MyUdpTransform_transform_destination (UDP_Transform_T *const udptf, void *context, const struct NETIO_Address *const destination, const NETIO_Packet_T *const in_packet, NETIO_Packet_T **packet_out, RTI_INT32 *const ec)
 Method to transform data based on a destination address.
RTI_PRIVATE RT_Component_T * MyUdpTransformFactory_create_component (struct RT_ComponentFactory *factory, struct RT_ComponentProperty *property, struct RT_ComponentListener *listener)
 Method called by RTI Connext DDS Micro to create an instance of transformation.
RTI_PRIVATE void MyUdpTransformFactory_delete_component (struct RT_ComponentFactory *factory, RT_Component_T *component)
 Method called by RTI Connext DDS Micro to delete an instance of transformation.
RTI_PRIVATE struct
RT_ComponentFactory * 
MyUdpTransformFactory_initialize (struct RT_ComponentFactoryProperty *property, struct RT_ComponentFactoryListener *listener)
 Method called by RTI Connext DDS Micro when a factory is registered.
RTI_PRIVATE void MyUdpTransformFactory_finalize (struct RT_ComponentFactory *factory, struct RT_ComponentFactoryProperty **property, struct RT_ComponentFactoryListener **listener)
 Method called by RTI Connext DDS Micro when a factory is unregistered.
RTI_BOOL MyUdpTransformFactory_register (RT_Registry_T *registry, const char *const name, struct MyUdpTransformFactoryProperty *property)
 Method to register this transformation in a registry.
RTI_BOOL MyUdpTransformFactory_unregister (RT_Registry_T *registry, const char *const name, struct MyUdpTransformFactoryProperty **property)
 Method to unregister this transformation from a registry.

Detailed Description

UDP Transform Example.

The UDP interface is implemented as a NETIO interface and NETIO interface factory.


Function Documentation

RTI_PRIVATE struct MyUdpTransform* MyUdpTransform_create ( struct MyUdpTransformFactory factory,
const struct UDP_TransformProperty *const  property 
)
read

Method to create an instance of MyUdpTransform.

Parameters:
[in]factoryThe factory creating this instance
[in]propertyGeneric UDP_Transform properties
Returns:
A pointer to MyUdpTransform on sucess, NULL on failure.

References MyUdpTransform::_parent, MyUdpTransform::buffer, MyUdpTransform::factory, MyUdpTransform::max_buffer_length, UDP_TransformProperty::max_send_message_size, OSAPI_ALIGNMENT_DEFAULT, OSAPI_Heap_allocate_buffer(), OSAPI_Heap_allocate_struct(), and OSAPI_Heap_free_struct().

Referenced by MyUdpTransformFactory_create_component().

RTI_PRIVATE void MyUdpTransform_delete ( struct MyUdpTransform t)

Method to delete an instance of MyUdpTransform.

Parameters:
[in]tTransformation instance to delete

References MyUdpTransform::buffer, OSAPI_Heap_free_buffer(), and OSAPI_Heap_free_struct().

Referenced by MyUdpTransformFactory_delete_component().

RTI_PRIVATE RTI_BOOL MyUdpTransform_create_destination_transform ( UDP_Transform_T *const  udptf,
void **const  context,
const struct NETIO_Address *const  destination,
const struct NETIO_Netmask *const  netmask,
void *  user_data,
const struct UDP_TransformProperty *const  property,
RTI_INT32 *const  ec 
)

Method to create a transformation for an destination address.

For each asserted destination rule a transform is created by the transformation instance. This method determines how a UDP payload is transformed before it is sent to an address that matches destination & netmask.

Parameters:
[in]udptfUDP Transform instance that creates the transformation
[out]contextPointer to a transformation context
[in]destinationDestination address for the transformation
[in]netmaskThe netmask to apply to this destination.
[in]user_dataThe user_data the rule was asserted with
[in]propertyUDP transform specific properties
[out]ecUser defined error code
Returns:
RTI_TRUE on success, RTI_FALSE on failure
RTI_PRIVATE RTI_BOOL MyUdpTransform_delete_destination_transform ( UDP_Transform_T *const  udptf,
void *  context,
const struct NETIO_Address *const  destination,
const struct NETIO_Netmask *const  netmask,
RTI_INT32 *const  ec 
)

Method to delete a transformation for an destination address.

Parameters:
[in]udptfUDP Transform instance that created the transformation
[out]contextPointer to a transformation context
[in]destinationDestination address for the transformation
[in]netmaskThe netmask to apply to this destination.
[out]ecUser defined error code
Returns:
RTI_TRUE on success, RTI_FALSE on failure
RTI_PRIVATE RTI_BOOL MyUdpTransform_create_source_transform ( UDP_Transform_T *const  udptf,
void **const  context,
const struct NETIO_Address *const  source,
const struct NETIO_Netmask *const  netmask,
void *  user_data,
const struct UDP_TransformProperty *const  property,
RTI_INT32 *const  ec 
)

Method to create a transformation for an source address.

For each asserted source rule a transform is created by the transformation instance. This method determines how a UDP payload is transformed when it is received from an address that matches source & netmask.

Parameters:
[in]udptfUDP Transform instance that creates the transformation
[out]contextPointer to a transformation context
[in]sourceDestination address for the transformation
[in]netmaskThe netmask to apply to this destination.
[in]user_dataThe user_data the rule was asserted with
[in]propertyUDP transform specific properties
[out]ecUser defined error code
Returns:
RTI_TRUE on success, RTI_FALSE on failure
RTI_PRIVATE RTI_BOOL MyUdpTransform_delete_source_transform ( UDP_Transform_T *const  udptf,
void *  context,
const struct NETIO_Address *const  source,
const struct NETIO_Netmask *const  netmask,
RTI_INT32 *const  ec 
)

Method to delete a transformation for an source address.

Parameters:
[in]udptfUDP Transform instance that created the transformation
[out]contextPointer to a transformation context
[in]sourceSource address for the transformation
[in]netmaskThe netmask to apply to this destination.
[out]ecUser defined error code
Returns:
RTI_TRUE on success, RTI_FALSE on failure
RTI_PRIVATE RTI_BOOL MyUdpTransform_transform_source ( UDP_Transform_T *const  udptf,
void *  context,
const struct NETIO_Address *const  source,
const NETIO_Packet_T *const  in_packet,
NETIO_Packet_T **  out_packet,
RTI_INT32 *const  ec 
)

Method to transform data based on a source address.

Parameters:
[in]udptfUDP_Transform_T that performs the transformation
[in]contextReference to context created by MyUdpTransform_create_source_transform
[in]sourceSource address for the transformation
[in]in_packetThe NETIO packet to transform
[out]out_packetThe transformed NETIO packet
[out]ecUser defined error code
Returns:
RTI_TRUE on success, RTI_FALSE on failure
RTI_PRIVATE RTI_BOOL MyUdpTransform_transform_destination ( UDP_Transform_T *const  udptf,
void *  context,
const struct NETIO_Address *const  destination,
const NETIO_Packet_T *const  in_packet,
NETIO_Packet_T **  packet_out,
RTI_INT32 *const  ec 
)

Method to transform data based on a destination address.

Parameters:
[in]udptfUDP_Transform_T that performs the transformation
[in]contextReference to context created by MyUdpTransform_create_destination_transform
[in]destinationSource address for the transformation
[in]in_packetThe NETIO packet to transform
[out]packet_outThe transformed NETIO packet
[out]ecUser defined error code
Returns:
RTI_TRUE on success, RTI_FALSE on failure
RTI_PRIVATE RT_Component_T* MyUdpTransformFactory_create_component ( struct RT_ComponentFactory *  factory,
struct RT_ComponentProperty *  property,
struct RT_ComponentListener *  listener 
)

Method called by RTI Connext DDS Micro to create an instance of transformation.

References MyUdpTransform::_parent, and MyUdpTransform_create().

RTI_PRIVATE void MyUdpTransformFactory_delete_component ( struct RT_ComponentFactory *  factory,
RT_Component_T *  component 
)

Method called by RTI Connext DDS Micro to delete an instance of transformation.

References MyUdpTransform_delete().

RTI_PRIVATE struct RT_ComponentFactory* MyUdpTransformFactory_initialize ( struct RT_ComponentFactoryProperty *  property,
struct RT_ComponentFactoryListener *  listener 
)
read

Method called by RTI Connext DDS Micro when a factory is registered.

References MyUdpTransformFactory::_parent, OSAPI_Heap_allocate_struct(), and MyUdpTransformFactory::property.

RTI_PRIVATE void MyUdpTransformFactory_finalize ( struct RT_ComponentFactory *  factory,
struct RT_ComponentFactoryProperty **  property,
struct RT_ComponentFactoryListener **  listener 
)

Method called by RTI Connext DDS Micro when a factory is unregistered.

References OSAPI_Heap_free_struct(), and MyUdpTransformFactory::property.

RTI_BOOL MyUdpTransformFactory_register ( RT_Registry_T *  registry,
const char *const  name,
struct MyUdpTransformFactoryProperty *  property 
)

Method to register this transformation in a registry.

References RT_Registry_register().

RTI_BOOL MyUdpTransformFactory_unregister ( RT_Registry_T *  registry,
const char *const  name,
struct MyUdpTransformFactoryProperty **  property 
)

Method to unregister this transformation from a registry.

References RT_Registry_unregister().


RTI Connext DDS Micro Version 2.4.11 Copyright © Mon Jul 23 2018 Real-Time Innovations, Inc