/* * (c) Copyright 2024, Real-Time Innovations, 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 disc_pluggable_h #define disc_pluggable_h #ifndef rti_makeheader_h #include "log/log_makeheader.h" #endif #ifndef reda_database_h #include "reda/reda_database.h" #endif #ifndef reda_weakReference_h #include "reda/reda_weakReference.h" #endif #ifndef reda_worker_h #include "reda/reda_worker.h" #endif #ifndef pres_common_h #include "pres/pres_common.h" #endif #ifndef pres_participant_h #include "pres/pres_participant.h" #endif #ifndef pres_psService_h #include "pres/pres_psService.h" #endif #ifndef pres_psReaderWriter_h #include "pres/pres_psReaderWriter.h" #endif #ifndef disc_dll_h #include "disc/disc_dll.h" #endif #ifndef disc_builtin_h #include "disc/disc_builtin.h" #endif #ifdef __cplusplus extern "C" { #endif /*e \file * \brief Defines the discovery protocol pluggable interface. */ /*e \defgroup DISCPluggableModule pluggable * \ingroup DISC * \brief Allows discovery protocols to be "plugged in". * * The internal pluggable discovery API directly reflects the public * Pluggable Discovery Framewrok (PDF) API. For additional information regarding * these API, please refer to the SDD. */ /*e \defgroup DISCPluggableParticipantModule Participant Discovery * \ingroup DISCPluggableModule */ /*e \defgroup DISCPluggableEndpointModule Endpoint Discovery * \ingroup DISCPluggableModule */ /*------------------------------------------------------------------------------ * INFRASTRUCTURE * ---------------------------------------------------------------------------*/ /*e \ingroup DISCPluggableModule * \brief Plugin manager. */ struct DISCPluginManager; /*e \ingroup DISCPluggableModule * \brief Handle to a registetered participant discovery plugin. */ struct DISCParticipantDiscoveryPlugin; /*e \ingroup DISCPluggableModule * \brief Handle to a registetered endpoint discovery plugin. */ struct DISCEndpointDiscoveryPlugin; /*e \ingroup DISCPluggableModule * \brief User-defined cookie parameter specified during remote entity * assertions to allow batch unregistrations or removals later. Cookie is a * per-plugin concept. */ struct DISCCookieHandle; /*e \ingroup DISCPluggableModule * \brief Cookie value; PDP and EDP listener callback \p compareCookies compares * this value. */ struct DISCCookieValue { RTI_UINT32 data[8]; }; /*e \ingroup DISCPluggableModule * \brief Handle to an asserted cookie. */ struct DISCCookieHandle { /* this is already in cookie's key, but duplicating it here allows a very * quick check */ struct DISCDiscoveryPlugin *_plugin; struct REDAWeakReference _cookieWR; }; /*e \ingroup DISCPluggableModule * \brief Support information for each discovery (enabled, changed, or deleted). */ struct DISCSourceInfo { /*e Where applicable, plugin-defined GUID of information source. */ struct MIGRtpsGuid srcGuid; /*e Where applicable, plugin-defined timestamp of information source. */ struct RTINtpTime srcTimestamp; }; /*e \ingroup DISCPluggableModule * \brief Used to initialize DISCSourceInfo. */ #define DISCSourceInfo_INITIALIZER \ { \ MIG_RTPS_GUID_UNKNOWN, /* srcGuid */ \ RTI_NTP_TIME_ZERO /* srcTimestamp */ \ } /*e \ingroup DISCPluggableModule * \brief Used to initialize DISCCookieValue. */ #define DISC_COOKIE_VALUE_INITIALIZE \ { \ { \ 0, 0, 0, 0, 0, 0, 0, 0 \ } /* data */ \ } /*e \ingroup DISCPluggableModule * \brief Return code - "other" error code. */ #define DISC_RETURN_PLUGIN_FAILED_OTHER 1 /*e \ingroup DISCPluggableModule * \brief Return code - asserting remote entity belongs to our own participant. */ #define DISC_RETURN_PLUGIN_FAILED_SELF 2 /*e \ingroup DISCPluggableModule * \brief Return code - attempting to remove/unregister an entity not previously * asserted by the plugin. */ #define DISC_RETURN_PLUGIN_FAILED_NOT_ASSERTED 3 #ifdef RTI_LM_ARCHITECTURE #define DISC_PLUGIN_MANAGER_OPT_PROPERTY_DEFAULT \ RTI_FALSE, /* isExpressWhitelisted */ #else #define DISC_PLUGIN_MANAGER_OPT_PROPERTY_DEFAULT #endif /*e \ingroup DISCPluggableModule \brief Default discovery plugin manager property. */ #define DISC_PLUGIN_MANAGER_PROPERTY_DEFAULT \ { \ MIG_RTPS_HOST_ID_UNKNOWN, /* hostId */ \ MIG_RTPS_APP_ID_UNKNOWN, /* appId */ \ MIG_RTPS_INSTANCE_ID_UNKNOWN, /* instanceId */ \ 0, /* domain ID */ \ MIG_RTPS_DOMAIN_TAG_DEFAULT, /* domainTag */ \ -1, /* edpRedundancyCount */ \ 256, /* maxPluginInfoParametersChars */ \ { \ (DISC_MAX_PDP_PLUGINS + DISC_MAX_EDP_PLUGINS) \ / 2, /* initial \ */ \ (DISC_MAX_PDP_PLUGINS + DISC_MAX_EDP_PLUGINS), /* maximal \ */ \ REDA_FAST_BUFFER_POOL_UNLIMITED /* increment */ \ }, /* pluginInfoParametersGrowth */ \ { \ 128, /* initial */ \ REDA_FAST_BUFFER_POOL_UNLIMITED, /* maximal */ \ REDA_FAST_BUFFER_POOL_UNLIMITED /* increment */ \ }, /* cookieAssertedEntitiesGrowth */ \ { { 16, \ REDA_FAST_BUFFER_POOL_UNLIMITED, \ REDA_FAST_BUFFER_POOL_UNLIMITED }, \ REDA_TABLE_USE_DEFAULT_VALUE }, /* remoteParticipantsTable \ */ \ { { 64, \ REDA_FAST_BUFFER_POOL_UNLIMITED, \ REDA_FAST_BUFFER_POOL_UNLIMITED }, \ REDA_TABLE_USE_DEFAULT_VALUE }, /* remoteWritersTable */ \ { { 64, \ REDA_FAST_BUFFER_POOL_UNLIMITED, \ REDA_FAST_BUFFER_POOL_UNLIMITED }, \ REDA_TABLE_USE_DEFAULT_VALUE }, /* remoteReadersTable */ \ { { 16, \ REDA_FAST_BUFFER_POOL_UNLIMITED, \ REDA_FAST_BUFFER_POOL_UNLIMITED }, \ REDA_TABLE_USE_DEFAULT_VALUE }, /* cookiesTable */ \ { 1, 0 }, /* entityRemovalSnooze */ \ RTI_TRUE, /* filterDomainBroadcastAnnouncements */ \ DISC_PLUGIN_MANAGER_OPT_PROPERTY_DEFAULT \ RTI_TRUE /* isEndpointDiscoveryEnabled */ \ } /*e \ingroup DISCPluggableModule * \brief Discovery plugin manager property. */ struct DISCPluginManagerProperty { /*e Host ID of the participant we are discovering for. */ MIGRtpsHostId hostId; /*e Application ID of the participant we are discovering for. */ MIGRtpsAppId appId; /*e Instance ID of the participant we are discovering for. */ MIGRtpsInstanceId instanceId; /*e Domain ID associated with the DISC plugin manager */ int domainId; /*e Domain Tag associated with the DISC plugin manager */ MIGRtpsDomainTag domainTag; /*e * The number of EDPs the plugin manager shall attempt to invoke upon * participant discovery. Use -1 to trigger all EDPs. */ int edpRedundancyCount; /*e * Max cumulative size of any single plugin's (PDP or EDP) info parameters. */ int maxPluginInfoParametersSize; /*e * Growth property of the number of plugins utilizing the info parameter. * Max size is recommended to be DISC_MAX_PDP_PLUGINS + * DISC_MAX_EDP_PLUGINS. */ struct REDAFastBufferPoolGrowthProperty pluginInfoParametersGrowth; /*e * Growth property of the number of remote entities asserted with cookies. * 2 plugins asserting the same remote entity counts as 2. 1 plugin * asserting the same remote entity twice with 2 different cookies also * counts as 2. */ struct REDAFastBufferPoolGrowthProperty cookieAssertedEntitiesGrowth; /*e Properties of the table storing discovered remote participants. */ struct REDATableProperty remoteParticipantsTable; /*e Properties of the table storing discovered remote writers. */ struct REDATableProperty remoteWritersTable; /*e Properties of the table storing discovered remote readers. */ struct REDATableProperty remoteReadersTable; /*e * Properties of the table storing cookies used during assertions; * determines the number of cookies. */ struct REDATableProperty cookiesTable; /*e Event generator "snooze" time for fully unregistered remote entities. */ struct RTINtpTime entityRemovalSnooze; /*e Filters domain broadcast announcements to default domain */ RTIBool filterDomainBroadcastAnnouncements; #ifdef RTI_LM_ARCHITECTURE /*i Whether this participant is whitelisted or not. Used for * Express-Edition. Whitelisted participants do not count towards license * limits. */ RTIBool isExpressWhitelisted; #endif /* * @brief Indicates whether endpoint discovery is initially disabled for * all the remote participants */ RTIBool isEndpointDiscoveryEnabled; }; /*e \ingroup DISCPluggableModule * \brief Create a new discovery plugin manager. * * @param participant \b In. Participant we are discovering for; must be * disabled. * @param database \b In. Database to be used by the discovery plugin manager to * store discovered remote entities. * @param tableEA \b In. EA to be used for discovery plugin manager tables. * @param recordEA \b In. EA to be used for records discovery plugin manager * tables. CURRENTLY NOT USED. * @param property \b In. Property of discovery plugin manager to create. * @param worker \b In. Worker context. * * @return Newly created discovery plugin manager. NULL if failed. */ extern DISCDllExport struct DISCPluginManager *DISCPluginManager_new( struct PRESParticipant *participant, struct REDADatabase *database, struct REDAExclusiveArea *tableEA, struct REDAExclusiveArea *recordEA, const struct DISCPluginManagerProperty *property, struct REDAWorker *worker); /*e \ingroup DISCPluggableModule * \brief Shutdown the discovery plugin manager. * @param me \b In. Self. * @param worker \b In. Worker context. */ extern DISCDllExport RTIBool DISCPluginManager_shutdown( struct DISCPluginManager *me, struct REDAWorker *worker); /*e \ingroup DISCPluggableModule * \brief Delete (memory free) the discovery plugin manager. * @param me \b In. Self. * @param worker \b In. Worker context. */ extern DISCDllExport RTIBool DISCPluginManager_delete( struct DISCPluginManager *me, struct REDAWorker *worker); /*e \ingroup DISCPluggableModule * \brief Register for a particular builtin topic. * * Received data samples are types of DISCBuiltinTopicParticipantData, * DISCBuiltinTopicPublicationData, and DISCBuiltinTopicSubscriptionData. * * @param me \b In. Self. * @param topicKind \b In. Builtin topic to register for. * @param reader \b In. Reader to forward relevant data to. * @param transformFnc \b In. Function to transform * DISCBuiltinTopicParticipantData, DISCBuiltinTopicPublicationData, or * DISCBuiltinTopicSubscriptionData to suitable reader queue types. * @param transformOption \b In. User-defined parameter available to the * transform function. * @param worker \b In. Worker context. * * @return Fails if the specified builtin topic is registered previously. */ extern DISCDllExport RTIBool DISCPluginManager_registerBuiltinTopic( struct DISCPluginManager *me, DISCBuiltinTopicKind topicKind, struct PRESPsReader *reader, PRESReaderTransformSampleFunction transformFnc, struct REDAWorker *worker); #define DISC_PLUGIN_CUSTOM_OPTIONS_DATA_MAX_SIZE 4 /*e \ingroup DISCPluggableModule * Kind defining what plugin is associated with the custom options. */ typedef enum { /*e * empty: used for indicating no properties are included. The discovery * manager will pass a null pluginOptions pointer to the involved APIs. */ DISC_PLUGIN_CUSTOM_OPTIONS_KIND_EMPTY, /*e * unknown: used for testing purposes */ DISC_PLUGIN_CUSTOM_OPTIONS_KIND_UNKNOWN, /*e * disc plugin (SDP or EDS): these options allow one to distinguish between * regular mode and proxy mode (used for supporting EDS in non-server * participants). Note that disc plugin APIs also support passing null * options (when triggered by custom plugins). */ DISC_PLUGIN_CUSTOM_OPTIONS_KIND_DISC, /*e * disc pa plugin (EDS server): these options allow one to distinguish * between an event triggered by a remote EDS client, or a remote EDS * server. */ DISC_PLUGIN_CUSTOM_OPTIONS_KIND_DISC_PA } DISCPluginCustomOptionsKind; /*e \ingroup DISCPluggableModule * \brief Structure specific to internal discovery plugins implementation, and * therefore not used in DDSC Discovery APIs. It passes user-defined data * associated with the current call. This is opposed to * DISCPluginListenerStorage, which caches a state for the plugin (it is not * associated to the current call). * * Note that when these options are used, we are coupling the call to a specific * set of PDPs and EDPs. In particular, only two groups of PDPs and EDPs could * be notified: * 1) the ones associated with a discovery plugin matching current custom * option's kind. * 2) the ones not using these custom options at all (e.g., user's custom * discovery plugins). A special case is disc.2.0, which is prepared to * handle both a null custom option (for user's custom plugins) and * simple discovery plugin custom option (used for supporting the EDS * proxy mode in non-server applications). * * Therefore, these options should be only set in plugins that need to * support special modes. Example of this are disc when supporting EDS mode, or * disc_pa to distinguish between Client/Server or InterServer discovery. * * @param kind \b In. Discovery Plugin Kind. It allows the implementation of * the API receiving these custom options to determine if it can process * this notification. It is up to the implementation to treat as a noop or * as an error the reception of an unsupported custom options parameter. * @param data \b In. Storage opaque to the manager containing plugin specific * options for the current call. */ struct DISCPluginCustomOptions { DISCPluginCustomOptionsKind kind; void *data[DISC_PLUGIN_CUSTOM_OPTIONS_DATA_MAX_SIZE]; }; /*e \ingroup DISCPluggableModule * \brief Used to initialize DISCPluginCustomOptions. */ #define DISC_PLUGIN_CUSTOM_OPTIONS_INITIALIZER \ { \ DISC_PLUGIN_CUSTOM_OPTIONS_KIND_EMPTY, /* kind */ \ { \ NULL, NULL, NULL, NULL \ } /* data */ \ } #define DISC_PLUGIN_LISTENER_STORAGE_DATA_MAX_SIZE 8 /*e \ingroup DISCPluggableModule * \brief Listener storage: structure for plugin implementers to cache * user-defined data completely opaque to the plugin manager */ struct DISCPluginListenerStorage { void *data[DISC_PLUGIN_LISTENER_STORAGE_DATA_MAX_SIZE]; }; /*e \ingroup DISCPluggableModule * \brief Used to initialize DISCPluginListenerStorage. */ #define DISC_PLUGIN_LISTENER_STORAGE_INITIALIZER \ { \ { \ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL \ } /* data */ \ } /* forward declaration for callbacks */ /*e \ingroup DISCPluggableModule * \brief To compare two cookie values. * * @param listenerStorage \b In. DDS_C plugin instance. * @param left \b In. Cookie value to compare. * @param right \b In. Cookie value to compare. * * @return This function must return the result of the "less-than" * comparison encoded in the following way: Return a negative integer * (<0) iff left < right, return 0 iff left == right, otherwise (case * where right < left) return a positive (>0) integer. */ typedef int (*DISCCookieValueCompareFunction)( const struct DISCPluginListenerStorage *listenerStorage, const struct DISCCookieValue *left, const struct DISCCookieValue *right); /*------------------------------------------------------------------------------ * PARTICIPANT DISCOVERY CALLBACKS * ---------------------------------------------------------------------------*/ struct DISCParticipantDiscoveryListener; /*e \ingroup DISCPluggableParticipantModule * \brief To retrieve information from the installed plugin. * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param builtin_endpoints \b Out. Which built-in endpoints the plugin * supports. * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. * * @return return RTI_TRUE on success. */ typedef void (*DISCParticipantDiscoveryListenerGetPluginInformation)( struct DISCParticipantDiscoveryListener *listener, struct DISCParticipantDiscoveryPlugin *plugin, PRESBuiltinEndpointMask *builtin_endpoints, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*e \ingroup DISCPluggableParticipantModule * \brief To notify after local participant is enabled. Discovery plugin * activities shall begin. * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param data \b In. Data of the newly enabled local participant (QoSs, etc). * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. */ typedef void ( *DISCParticipantDiscoveryListenerOnAfterLocalParticipantEnabledCallback)( struct DISCParticipantDiscoveryListener *listener, struct DISCParticipantDiscoveryPlugin *plugin, const struct DISCBuiltinTopicParticipantData *data, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*e \ingroup DISCPluggableParticipantModule * \brief To notify after local participant has changed (QoSs, etc). * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param data \b In. Newly changed data of the local participant (QoSs, etc). * @param listenerStorage \b In. DDS_C plugin instance. * @param reserved \b Out. A parameter only to be used by RTI DDS builtin * discovery plugins. * @param worker \b In. Worker context. */ typedef void ( *DISCParticipantDiscoveryListenerOnAfterLocalParticipantChangedCallback)( struct DISCParticipantDiscoveryListener *listener, struct DISCParticipantDiscoveryPlugin *plugin, const struct DISCBuiltinTopicParticipantData *data, const struct DISCPluginListenerStorage *listenerStorage, void *reserved, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * \brief To notify after remote participant is discovered. Plugin can determine * whether it can exchange endpoints with the new remote participant. * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param data \b In. Data of the newly enabled remote participant (QoSs, etc). * @param pluginOptions \b In. User-defined parameter specified by plugin * triggering this callback. * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. */ typedef void ( *DISCParticipantDiscoveryListenerOnAfterRemoteParticipantEnabledCallback)( struct DISCParticipantDiscoveryListener *listener, struct DISCParticipantDiscoveryPlugin *plugin, const struct DISCBuiltinTopicParticipantData *data, const struct DISCPluginCustomOptions *pluginOptions, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule *\brief To notify after remote participant is authenticated. * Plugin can determine whether it can exchange endpoints with the new * remote participant. * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param data \b In. Data of the newly enabled remote participant (QoSs, etc). * @param pluginOptions \b In. User-defined parameter specified by plugin * triggering this callback. * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. */ typedef void ( *DISCParticipantDiscoveryListenerOnAfterRemoteParticipantAuthenticatedCallback)( struct DISCParticipantDiscoveryListener *listener, struct DISCParticipantDiscoveryPlugin *plugin, const struct DISCBuiltinTopicParticipantData *data, const struct DISCPluginCustomOptions *pluginOptions, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * \brief To notify after remote participant has changed. * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Participant discovery plugin to update. * @param data \b In. Updated data for the remote participant (QoSs, etc). * @param data \b In. Old version of the data for the remote participant. * @param pluginOptions \b In. User-defined parameter specified by plugin * triggering this callback. * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. */ typedef void ( *DISCParticipantDiscoveryListenerOnAfterRemoteParticipantChangedCallback)( struct DISCParticipantDiscoveryListener *listener, struct DISCParticipantDiscoveryPlugin *plugin, const struct DISCBuiltinTopicParticipantData *data, const struct DISCBuiltinTopicParticipantData *oldData, const struct DISCPluginCustomOptions *pluginOptions, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*e \ingroup DISCPluggableParticipantModule * \brief To notify before a remote participant is ignored. * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param guid \b In. GUID of the remote participant to be ignored. * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. */ typedef void ( *DISCParticipantDiscoveryListenerOnBeforeRemoteParticipantIgnoredCallback)( struct DISCParticipantDiscoveryListener *listener, struct DISCParticipantDiscoveryPlugin *plugin, const struct MIGRtpsGuid *guid, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*e \ingroup DISCPluggableParticipantModule * \brief This is called to notify the participant discovery plugin that a * remote participant is going to be removed from the local participant. * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param guid \b In. GUID of the remote participant to be removed. * @param metatrafficMulticastLocator \b In. Discovery multicast locators for * the remote participant. * @param metatrafficUnicastLocator \b In. Discovery unicast locators for * the remote participant. * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. */ typedef void ( *DISCParticipantDiscoveryListenerOnBeforeRemoteParticipantRemovedCallback)( struct DISCParticipantDiscoveryListener *listener, struct DISCParticipantDiscoveryPlugin *plugin, const struct MIGRtpsGuid *guid, const struct PRESLocatorQosPolicy *metatrafficMulticastLocator, const struct PRESLocatorQosPolicy *metatrafficUnicastLocator, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*e \ingroup DISCPluggableParticipantModule * \brief To notify before local participant is deleted. No additional discovery * plugin manager API shall be used by the plugin after returning from this * callback. * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param guid \b In. GUID of the local participant to be deleted. * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. */ typedef void ( *DISCParticipantDiscoveryListenerOnBeforeLocalParticipantDeletedCallback)( struct DISCParticipantDiscoveryListener *listener, struct DISCParticipantDiscoveryPlugin *plugin, const struct MIGRtpsGuid *guid, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*e \ingroup DISCPluggableParticipantModule * \brief To notify after local participant is enabled. Plugin can announce the * death of the participant. * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param guid \b In. GUID of the local participant to be deleted. * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. */ typedef void ( *DISCParticipantDiscoveryListenerOnAfterLocalParticipantDeletedCallback)( struct DISCParticipantDiscoveryListener *listener, struct DISCParticipantDiscoveryPlugin *plugin, const struct MIGRtpsGuid *guid, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*i * \ingroup DISCPluggableParticipantModule * \brief Called before the remote participant config writer is removed. * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param remoteParticipantId \b In. GUID prefix of the remote participant that * whose config writer is being removed. */ typedef void ( *DISCParticipantDiscoveryListenerOnBeforeReauthenticatedRemoteParticipantConfigWriterRemovedCallback)( struct DISCParticipantDiscoveryListener *listener, struct DISCParticipantDiscoveryPlugin *plugin, const MIGRtpsParticipantId *remoteParticipantId, struct REDAWorker *worker); /* * ----------------------------------------------------------------------------- * PARTICIPANT DISCOVERY STRUCT * ------------------------------------------------------------------------------ */ /*e * \ingroup DISCPluggableParticipantModule * \brief Used by plugin to be notified of local participant * information. */ struct DISCParticipantDiscoveryListener { /*e * User-defined function to compare and sort its cookies used during * assertions. Compare 2 instances of DISCCookieValue. */ DISCCookieValueCompareFunction compareCookies; /*e */ DISCParticipantDiscoveryListenerGetPluginInformation getPluginInformation; /*e */ DISCParticipantDiscoveryListenerOnAfterLocalParticipantEnabledCallback onAfterLocalParticipantEnabled; /*e */ DISCParticipantDiscoveryListenerOnAfterRemoteParticipantEnabledCallback onAfterRemoteParticipantEnabled; /*e */ DISCParticipantDiscoveryListenerOnAfterRemoteParticipantAuthenticatedCallback onAfterRemoteParticipantAuthenticated; /*e */ DISCParticipantDiscoveryListenerOnAfterLocalParticipantChangedCallback onAfterLocalParticipantChanged; /*e */ DISCParticipantDiscoveryListenerOnAfterRemoteParticipantChangedCallback onAfterRemoteParticipantChanged; /*e */ DISCParticipantDiscoveryListenerOnBeforeRemoteParticipantIgnoredCallback onBeforeRemoteParticipantIgnored; /*e */ DISCParticipantDiscoveryListenerOnBeforeRemoteParticipantRemovedCallback onBeforeRemoteParticipantRemoved; /*e */ DISCParticipantDiscoveryListenerOnBeforeLocalParticipantDeletedCallback onBeforeLocalParticipantDeleted; /*e */ DISCParticipantDiscoveryListenerOnAfterLocalParticipantDeletedCallback onAfterLocalParticipantDeleted; /*i * This should be implemented for SPDP2 and an implementation may be needed * for SPDP to support an SPDP2 compatibility mode, but is otherwise an * internal callback. */ DISCParticipantDiscoveryListenerOnBeforeReauthenticatedRemoteParticipantConfigWriterRemovedCallback onBeforeReauthenticatedRemoteParticipantConfigWriterRemoved; }; /*e \ingroup DISCPluggableModule * \brief Set the listener storage in a participant discovery plugin. This * should be done before the participant is enabled. * * @param me \b In. Self. * @param listenerStorage \b In. Pointer to listener storage to assign to * plugin. * @param index \b In. Index of participant discovery plugin to assign. * * @return RTI_TRUE if success, otherwise RTI_FALSE. */ extern DISCDllExport RTIBool DISCPluginManager_setPdpListenerStorage( struct DISCPluginManager *me, const struct DISCPluginListenerStorage *listenerStorage, const int index); /*e \ingroup DISCPluggableModule * \brief Get pointer to a DISCParticipantDiscoveryListener * * @param me \b In. Self. * @param index \b In. Index of listener to get pointer to. * * @return pointer to DISCParticipantDiscoveryListener if it exists, * otherwise NULL. */ extern DISCDllExport struct DISCParticipantDiscoveryListener * DISCPluginManager_getPdpListener(struct DISCPluginManager *me, int index); /*e \ingroup DISCPluggableModule * \brief Register a new participant discovery plugin. * * @param me \b In. Self. * @param listener \b In. Listener to receive notifications. Must remain valid * throughout plugin lifecycle. Can be user-derived. * @param worker \b In. Worker context. * * @return Fails if owning participant is not disabled or if * DISC_MAX_PDP_PLUGINS is exceeded. */ extern DISCDllExport struct DISCParticipantDiscoveryPlugin * DISCPluginManager_registerParticipantDiscoveryPlugin( struct DISCPluginManager *me, const struct DISCParticipantDiscoveryListener *listener, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*------------------------------------------------------------------------------ * PARTICIPANT DISCOVERY ASSERT/REMOVE * ---------------------------------------------------------------------------*/ /*e \ingroup DISCPluggableParticipantModule * \brief Assert a cookie for use with future assertion calls. * * @param me \b In. Self. * @param failReason \b Out. Additional information on failure. Can be NULL. * @param cookieHandle \b Out. Handle to the newly asserted cookie. * @param value \b In. Value of the cookie to assert. * @param worker \b In. Worker context. */ extern DISCDllExport RTIBool DISCParticipantDiscoveryPlugin_assertCookie( struct DISCParticipantDiscoveryPlugin *me, int *failReason, struct DISCCookieHandle *cookieHandle, const struct DISCCookieValue *value, struct REDAWorker *worker); /*e \ingroup DISCPluggableParticipantModule * \brief Remove a cookie asserted previously. * * @param me \b In. Self. * @param failReason \b Out. Additional information on failure. Can be NULL. * @param cookieHandle \b In. Handle to the cookie to remove. * @param worker \b In. Worker context. */ extern DISCDllExport RTIBool DISCParticipantDiscoveryPlugin_removeCookie( struct DISCParticipantDiscoveryPlugin *me, int *failReason, const struct DISCCookieHandle *cookieHandle, struct REDAWorker *worker); /*e \ingroup DISCPluggableParticipantModule * \brief Remove a cookie asserted previously by its value. * * @param me \b In. Self. * @param failReason \b Out. Additional information on failure. Can be NULL. * @param value \b In. Value of the cookie to remove. * @param worker \b In. Worker context. */ extern DISCDllExport RTIBool DISCParticipantDiscoveryPlugin_removeCookieByValue( struct DISCParticipantDiscoveryPlugin *me, int *failReason, const struct DISCCookieValue *value, struct REDAWorker *worker); /*e * \ingroup DISCPluggableParticipantModule * \brief Assert or update a newly discovered or newly updated remote * participant. This asserts both the bootstrap and config information. * * @param me \b In. Self. * @param alreadyExists \b Out. Set to RTI_TRUE if the remote participant * already exists. Can be NULL. * @param ignoredByUser \b Out. Whether participant is ignored by user. Can be * NULL. * @param participantData \b In. Data (QoSs, etc) of remote participant. * @param sourceInfo \b In. Additional information to support the discovery. Can * be NULL. * @param cookieHandle \b In. User-defined cookie for batch unregistrations and * removals. Can be NULL. * @param pluginOptions \b In. User-defined parameter specified by plugin * triggering this callback. * @param worker \b In. Worker context. * * @return RTI_TRUE on success. Ignored participants are not considered failure; * they are rather conveyed via \p ignoredByUser. */ extern DISCDllExport RTIBool DISCParticipantDiscoveryPlugin_assertRemoteParticipantFull( struct DISCParticipantDiscoveryPlugin *me, RTIBool *alreadyExists, RTIBool *ignoredByUser, const struct DISCBuiltinTopicParticipantData *participantData, const struct DISCSourceInfo *sourceInfo, const struct DISCCookieHandle *cookieHandle, const struct DISCPluginCustomOptions *pluginOptions, struct REDAWorker *worker); /*e \ingroup DISCPluggableParticipantModule * \brief Withdraw a previous assertion of a remote participant. * * @param me \b In. Self. * @param failReason \b Out. Additional information on failure. Can be NULL. * @param guid \b In. GUID of remote participant to withdraw. * @param sourceInfo \b In. Additional information to support the discovery. Can * be NULL. * @param worker \b In. Worker context. * * @return Fails if the remote participant was not previously asserted by the * plugin. */ extern DISCDllExport RTIBool DISCParticipantDiscoveryPlugin_unregisterRemoteParticipant( struct DISCParticipantDiscoveryPlugin *me, int *failReason, const struct MIGRtpsGuid *guid, const struct DISCSourceInfo *sourceInfo, struct REDAWorker *worker); /*e \ingroup DISCPluggableParticipantModule * \brief Unregister all remote participants asserted with a given cookie. * * @param me \b In. Self. * @param failReason \b Out. Additional information on failure. Can be NULL. * @param cookieHandle \b In. Cookie to match. * @param sourceInfo \b In. Additional information to support the discovery. Can * be NULL. * @param worker \b In. Worker context. */ extern DISCDllExport RTIBool DISCParticipantDiscoveryPlugin_unregisterRemoteParticipantsByCookie( struct DISCParticipantDiscoveryPlugin *me, int *failReason, const struct DISCCookieHandle *cookieHandle, const struct DISCSourceInfo *sourceInfo, struct REDAWorker *worker); /*e \ingroup DISCPluggableParticipantModule * \brief Delete a previously asserted remote participant. * * @param me \b In. Self. * @param failReason \b Out. Additional information on failure. Can be NULL. * @param guid \b In. GUID of remote participant to delete. * @param sourceInfo \b In. Additional information to support the discovery. Can * be NULL. * @param worker \b In. Worker context. * * @return Fails if the remote participant was not previously asserted by the * plugin. */ extern DISCDllExport RTIBool DISCParticipantDiscoveryPlugin_removeRemoteParticipant( struct DISCParticipantDiscoveryPlugin *me, int *failReason, const struct MIGRtpsGuid *guid, const struct DISCSourceInfo *sourceInfo, struct REDAWorker *worker); /*e \ingroup DISCPluggableParticipantModule * \brief Delete all remote participants asserted with a given cookie. * * @param me \b In. Self. * @param failReason \b Out. Additional information on failure. Can be NULL. * @param cookieHandle \b In. Cookie to match. * @param sourceInfo \b In. Additional information to support the discovery. Can * be NULL. * @param worker \b In. Worker context. */ extern DISCDllExport RTIBool DISCParticipantDiscoveryPlugin_removeRemoteParticipantsByCookie( struct DISCParticipantDiscoveryPlugin *me, int *failReason, const struct DISCCookieHandle *cookieHandle, const struct DISCSourceInfo *sourceInfo, struct REDAWorker *worker); /*------------------------------------------------------------------------------ * PARTICIPANT DISCOVERY OTHER FUNCTIONS * ---------------------------------------------------------------------------*/ /*e \ingroup DISCPluggableParticipantModule * \brief Gets the userData associated with a participant discover plugin. * * @param me \b In. Self. */ extern DISCDllExport void *DISCParticipantDiscoveryPlugin_getUserData( struct DISCParticipantDiscoveryPlugin *me); /*e \ingroup DISCPluggableParticipantModule * \brief Sets the userData associated with a participant discover plugin. * * @param me \b In. Self. * @param userData \b In. User data. */ extern DISCDllExport void DISCParticipantDiscoveryPlugin_setUserData( struct DISCParticipantDiscoveryPlugin *me, void *userData); /*e \ingroup DISCPluggableParticipantModule * \brief Gets the table EA associated with a participant discovery plugin * * @param me \b In. Self. */ extern DISCDllExport struct REDAExclusiveArea * DISCParticipantDiscoveryPlugin_getTableEa( const struct DISCParticipantDiscoveryPlugin *me); /*e \ingroup DISCPluggableParticipantModule * \brief Gets the participant associated with a participant discovery plugin * * @param me \b In. Self. */ extern DISCDllExport struct PRESParticipant * DISCParticipantDiscoveryPlugin_getParticipant( const struct DISCParticipantDiscoveryPlugin *me); /*------------------------------------------------------------------------------ ENDPOINT DISCOVERY CALLBACKS ------------------------------------------------------------------------------*/ /* forward declaration for callbacks */ struct DISCEndpointDiscoveryListener; /*e \ingroup DISCPluggableEndpointModule * \brief To retrieve information from the installed plugin. * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param builtin_endpoints \b Out. Which built-in endpoints the plugin * supports. * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. * * @return return RTI_TRUE on success */ typedef void (*DISCEndpointDiscoveryListenerGetPluginInformation)( struct DISCEndpointDiscoveryListener *listener, struct DISCEndpointDiscoveryPlugin *plugin, PRESBuiltinEndpointMask *builtin_endpoints, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * \brief To notify after local participant is enabled. Discovery plugin * activities shall begin. * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param data \b In. Data of the newly enabled local participant (QoSs, etc). * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. */ typedef void ( *DISCEndpointDiscoveryListenerOnAfterLocalParticipantEnabledCallback)( struct DISCEndpointDiscoveryListener *listener, struct DISCEndpointDiscoveryPlugin *plugin, const struct DISCBuiltinTopicParticipantData *data, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * \brief To notify before local participant is deleted. No additional discovery * plugin manager API shall be used by the plugin after returning from this * callback. * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param guid \b In. GUID of the local participant to be deleted. * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. */ typedef void ( *DISCEndpointDiscoveryListenerOnBeforeLocalParticipantDeletedCallback)( struct DISCEndpointDiscoveryListener *listener, struct DISCEndpointDiscoveryPlugin *plugin, const struct MIGRtpsGuid *guid, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * \brief To notify after remote participant is discovered. Plugin can determine * whether it can exchange endpoints with the new remote participant. * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param discoveredByPdp \b In. Information of the PDP which discovered the * remote participant. * @param data \b In. Data of the newly enabled remote participant (QoSs, etc). * @param pluginOptions \b In. User-defined parameter specified by plugin * triggering this callback. * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. * * @return RTI_TRUE if the endpoint discovery plugin accepts the new remote * participant. */ typedef RTIBool ( *DISCEndpointDiscoveryListenerOnAfterRemoteParticipantEnabledCallback)( struct DISCEndpointDiscoveryListener *listener, struct DISCEndpointDiscoveryPlugin *plugin, const struct DISCBuiltinTopicParticipantData *data, const struct DISCPluginCustomOptions *pluginOptions, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * \brief To notify after remote participant is unregistered by any (not * necessarily all) PDP. * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param unregisteredByPdp \b In. Information of the PDP which unregistered the * remote participant. * @param guid \b In. GUID of the newly discovered remote participant. * @param previousReply \b In. This EDP's response when * DISCEndpointDiscoveryListenerOnAfterRemoteParticipantEnabledCallback() was * called. * @param fullyUnregistered \b In. Whether all PDPs have unregistered the remote * participant. * @param pluginOptions \b In. User-defined parameter specified by plugin * triggering this callback. * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. */ typedef void ( *DISCEndpointDiscoveryListenerOnBeforeRemoteParticipantUnregisteredCallback)( struct DISCEndpointDiscoveryListener *listener, struct DISCEndpointDiscoveryPlugin *plugin, const struct MIGRtpsGuid *guid, RTIBool previousReply, RTIBool fullyUned, const struct DISCPluginCustomOptions *pluginOptions, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * \brief To notify after remote participant is deleted by a PDP. * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param deletedByPdp \b In. Information of the PDP which deleted the remote * participant. * @param guid \b In. GUID of the newly discovered remote participant. * @param previousReply \b In. This EDP's response when * DISCEndpointDiscoveryListenerOnAfterRemoteParticipantEnabledCallback() was * called. * @param pluginOptions \b In. User-defined parameter specified by plugin * triggering this callback. * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. */ typedef void ( *DISCEndpointDiscoveryListenerOnBeforeRemoteParticipantDeletedCallback)( struct DISCEndpointDiscoveryListener *listener, struct DISCEndpointDiscoveryPlugin *plugin, const struct MIGRtpsGuid *guid, RTIBool previousReply, const struct DISCPluginCustomOptions *pluginOptions, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * \brief To notify after local data writer is enabled. * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param data \b In. Data of the newly enabled local data writer (QoSs, etc). * @param useSecureChannel \b In. Indicates if the announcement message must be * sent through a secure channel. * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. */ typedef void (*DISCEndpointDiscoveryListenerOnAfterLocalWriterEnabledCallback)( struct DISCEndpointDiscoveryListener *listener, struct DISCEndpointDiscoveryPlugin *plugin, const struct DISCBuiltinTopicPublicationData *data, RTIBool useSecureChannel, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * \brief To notify after local data writer is changed (QoSs, etc). * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param data \b In. Data of the newly changed local data writer (QoSs, etc). * @param useSecureChannel \b In. Indicates if the announcement message must be * sent through a secure channel. * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. */ typedef void (*DISCEndpointDiscoveryListenerOnAfterLocalWriterChangedCallback)( struct DISCEndpointDiscoveryListener *listener, struct DISCEndpointDiscoveryPlugin *plugin, const struct DISCBuiltinTopicPublicationData *data, RTIBool useSecureChannel, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * \brief To notify after local data writer is deleted. * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param guid \b In. GUID of the newly deleted local data writer. * @param useSecureChannel \b In. Indicates if the dispose message to * the remote participant must be sent through a secure channel. * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. */ typedef void (*DISCEndpointDiscoveryListenerOnAfterLocalWriterDeletedCallback)( struct DISCEndpointDiscoveryListener *listener, struct DISCEndpointDiscoveryPlugin *plugin, const struct MIGRtpsGuid *guid, RTIBool useSecureChannel, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * \brief To notify after local data reader is enabled. * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param data \b In. Data of the newly enabled local data reader (QoSs, etc). * @param useSecureChannel \b In. Indicates if the announcement message must be * sent through a secure channel. * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. */ typedef void (*DISCEndpointDiscoveryListenerOnAfterLocalReaderEnabledCallback)( struct DISCEndpointDiscoveryListener *listener, struct DISCEndpointDiscoveryPlugin *plugin, const struct DISCBuiltinTopicSubscriptionData *data, RTIBool useSecureChannel, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * \brief To notify after local data reader is changed (QoSs, etc). * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param data \b In. Data of the newly changed local data reader (QoSs, etc). * @param useSecureChannel \b In. Indicates if the announcement message must be * sent through a secure channel. * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. */ typedef void (*DISCEndpointDiscoveryListenerOnAfterLocalReaderChangedCallback)( struct DISCEndpointDiscoveryListener *listener, struct DISCEndpointDiscoveryPlugin *plugin, const struct DISCBuiltinTopicSubscriptionData *data, RTIBool useSecureChannel, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * \brief To notify after local data reader is deleted. * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param guid \b In. Data of the newly deleted local data reader. * @param useSecureChannel \b In. Indicates if the dispose message to * the remote participant must be sent through a secure channel. * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. */ typedef void (*DISCEndpointDiscoveryListenerOnAfterLocalReaderDeletedCallback)( struct DISCEndpointDiscoveryListener *listener, struct DISCEndpointDiscoveryPlugin *plugin, const struct MIGRtpsGuid *guid, RTIBool useSecureChannel, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * \brief To notify after type is resolved for a remote endpoint. * * @param listener \b In. Self, as passed in by user at registration time. * @param plugin \b In. Self. * @param remoteEndpointCursor \b In/out. Cursor to access the remote endpoint. * @param guid \b In. GUID of the remote endpoint whose type was resolved. * @param listenerStorage \b In. DDS_C plugin instance. * @param worker \b In. Worker context. */ typedef RTIBool ( *DISCEndpointDiscoveryListenerOnAfterRemoteEndpointTypeResolvedCallback)( struct DISCEndpointDiscoveryListener *listener, struct DISCEndpointDiscoveryPlugin *plugin, struct REDACursor *remoteEndpointCursor, const struct MIGRtpsGuid *remoteEndpointGuid, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*------------------------------------------------------------------------------ * ENDPOINT DISCOVERY STRUCT * ---------------------------------------------------------------------------*/ /*e \ingroup DISCPluggableEndpointModule * \brief Used by plugin to be notified of local participant and endpoint * information. */ struct DISCEndpointDiscoveryListener { /*e * User-defined function to compare and sort its cookies used during * assertions. Compare 2 instances of DISCCookieValue. */ DISCCookieValueCompareFunction compareCookies; /*e */ DISCEndpointDiscoveryListenerGetPluginInformation getPluginInformation; /*e */ DISCEndpointDiscoveryListenerOnAfterLocalParticipantEnabledCallback onAfterLocalParticipantEnabled; /*e */ DISCEndpointDiscoveryListenerOnBeforeLocalParticipantDeletedCallback onBeforeLocalParticipantDeleted; /*e */ DISCEndpointDiscoveryListenerOnAfterRemoteParticipantEnabledCallback onAfterRemoteParticipantEnabled; /*e */ DISCEndpointDiscoveryListenerOnBeforeRemoteParticipantUnregisteredCallback onBeforeRemoteParticipantUnregistered; /*e */ DISCEndpointDiscoveryListenerOnBeforeRemoteParticipantDeletedCallback onBeforeRemoteParticipantDeleted; /*e */ DISCEndpointDiscoveryListenerOnAfterLocalWriterEnabledCallback onAfterLocalWriterEnabled; /*e */ DISCEndpointDiscoveryListenerOnAfterLocalWriterChangedCallback onAfterLocalWriterChanged; /*e */ DISCEndpointDiscoveryListenerOnAfterLocalWriterDeletedCallback onAfterLocalWriterDeleted; /*e */ DISCEndpointDiscoveryListenerOnAfterLocalReaderEnabledCallback onAfterLocalReaderEnabled; /*e */ DISCEndpointDiscoveryListenerOnAfterLocalReaderChangedCallback onAfterLocalReaderChanged; /*e */ DISCEndpointDiscoveryListenerOnAfterLocalReaderDeletedCallback onAfterLocalReaderDeleted; /*i */ DISCEndpointDiscoveryListenerOnAfterRemoteEndpointTypeResolvedCallback onAfterRemoteEndpointTypeResolved; }; /*e \ingroup DISCPluggableModule * \brief Register a new endpoint discovery plugin. * * @param me \b In. Self. * @param listener \b In. Listener to receive notifications. Must remain valid * throughout plugin lifecycle. Can be user-derived. * @param worker \b In. Worker context. * * @return Fails if owning participant is not disabled or if * DISC_MAX_EDP_PLUGINS is exceeded. */ extern DISCDllExport struct DISCEndpointDiscoveryPlugin * DISCPluginManager_registerEndpointDiscoveryPlugin( struct DISCPluginManager *me, const struct DISCEndpointDiscoveryListener *listener, const struct DISCPluginListenerStorage *listenerStorage, struct REDAWorker *worker); /*------------------------------------------------------------------------------ * ENDPOINT DISCOVERY ASSERT/REMOVE * ---------------------------------------------------------------------------*/ /*e \ingroup DISCPluggableEndpointModule * \brief Assert a cookie for use with future assertion calls. * * @param me \b In. Self. * @param failReason \b Out. Additional information on failure. Can be NULL. * @param cookieHandle \b Out. Handle to the newly asserted cookie. * @param value \b In. Value of the cookie to assert. * @param worker \b In. Worker context. */ extern DISCDllExport RTIBool DISCEndpointDiscoveryPlugin_assertCookie( struct DISCEndpointDiscoveryPlugin *me, int *failReason, struct DISCCookieHandle *cookieHandle, const struct DISCCookieValue *value, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * \brief Remove a cookie asserted previously. * * @param me \b In. Self. * @param failReason \b Out. Additional information on failure. Can be NULL. * @param cookieHandle \b In. Handle to the cookie to remove. * @param worker \b In. Worker context. */ extern DISCDllExport RTIBool DISCEndpointDiscoveryPlugin_removeCookie( struct DISCEndpointDiscoveryPlugin *me, int *failReason, const struct DISCCookieHandle *cookieHandle, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * \brief Remove a cookie asserted previously by its value. * * @param me \b In. Self. * @param failReason \b Out. Additional information on failure. Can be NULL. * @param value \b In. Value of the cookie to remove. * @param worker \b In. Worker context. */ extern DISCDllExport RTIBool DISCEndpointDiscoveryPlugin_removeCookieByValue( struct DISCEndpointDiscoveryPlugin *me, int *failReason, const struct DISCCookieValue *value, struct REDAWorker *worker); /*e * \ingroup DISCPluggableEndpointModule * \brief Assert or update a newly discovered or newly updated remote data * writer. * * @param me \b In. Self. * @param failReason \b Out. Additional information on failure. Can be NULL. * @param publicationData \b In. Data (QoSs, etc) of remote data writer. * @param cookieHandle \b In. User-defined cookie for batch unregistrations and * removals. Can be NULL. * @param sourceInfo \b In. Additional information to support the discovery. * @param worker \b In. Worker context. */ extern DISCDllExport RTIBool DISCEndpointDiscoveryPlugin_assertRemoteWriter( struct DISCEndpointDiscoveryPlugin *me, int *failReason, const struct DISCBuiltinTopicPublicationData *publicationData, const struct DISCSourceInfo *sourceInfo, const struct DISCCookieHandle *cookieHandle, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * \brief Withdraw a previous assertion of a remote data writer. * * @param me \b In. Self. * @param failReason \b Out. Additional information on failure. Can be NULL. * @param guid \b In. GUID of remote data writer to withdraw. * @param sourceInfo \b In. Additional information to support the discovery. Can * be NULL. * @param worker \b In. Worker context. */ extern DISCDllExport RTIBool DISCEndpointDiscoveryPlugin_unregisterRemoteWriter( struct DISCEndpointDiscoveryPlugin *me, int *failReason, const struct MIGRtpsGuid *guid, const struct DISCSourceInfo *sourceInfo, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * \brief Unregister all remote data writers asserted with a given cookie. * * @param me \b In. Self. * @param failReason \b Out. Additional information on failure. Can be NULL. * @param cookieHandle \b In. Cookie to match. * @param sourceInfo \b In. Additional information to support the discovery. Can * be NULL. * @param worker \b In. Worker context. */ extern DISCDllExport RTIBool DISCEndpointDiscoveryPlugin_unregisterRemoteWritersByCookie( struct DISCEndpointDiscoveryPlugin *me, int *failReason, const struct DISCCookieHandle *cookieHandle, const struct DISCSourceInfo *sourceInfo, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * \brief Delete a previously asserted remote data writer. * * @param me \b In. Self. * @param failReason \b Out. Additional information on failure. Can be NULL. * @param guid \b In. GUID of remote data writer to delete. * @param sourceInfo \b In. Additional information to support the discovery. Can * be NULL. * @param worker \b In. Worker context. */ extern DISCDllExport RTIBool DISCEndpointDiscoveryPlugin_removeRemoteWriter( struct DISCEndpointDiscoveryPlugin *me, int *failReason, const struct MIGRtpsGuid *guid, const struct DISCSourceInfo *sourceInfo, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * \brief Delete all remote data writers asserted with a given cookie. * * @param me \b In. Self. * @param failReason \b Out. Additional information on failure. Can be NULL. * @param cookieHandle \b In. Cookie to match. * @param sourceInfo \b In. Additional information to support the discovery. Can * be NULL. * @param worker \b In. Worker context. */ extern DISCDllExport RTIBool DISCEndpointDiscoveryPlugin_removeRemoteWritersByCookie( struct DISCEndpointDiscoveryPlugin *me, int *failReason, const struct DISCCookieHandle *cookieHandle, const struct DISCSourceInfo *sourceInfo, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * * @see DISCEndpointDiscoveryPlugin_assertRemoteWriter */ extern DISCDllExport RTIBool DISCEndpointDiscoveryPlugin_assertRemoteReader( struct DISCEndpointDiscoveryPlugin *me, int *failReason, const struct DISCBuiltinTopicSubscriptionData *subscriptionData, const struct DISCSourceInfo *sourceInfo, const struct DISCCookieHandle *cookieHandle, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * * @see DISCEndpointDiscoveryPlugin_unregisterRemoteWriter */ extern DISCDllExport RTIBool DISCEndpointDiscoveryPlugin_unregisterRemoteReader( struct DISCEndpointDiscoveryPlugin *me, int *failReason, const struct MIGRtpsGuid *guid, const struct DISCSourceInfo *sourceInfo, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * * @see DISCEndpointDiscoveryPlugin_unregisterRemoteWritersByCookie */ extern DISCDllExport RTIBool DISCEndpointDiscoveryPlugin_unregisterRemoteReadersByCookie( struct DISCEndpointDiscoveryPlugin *me, int *failReason, const struct DISCCookieHandle *cookieHandle, const struct DISCSourceInfo *sourceInfo, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * * @see DISCEndpointDiscoveryPlugin_removeRemoteWriter */ extern DISCDllExport RTIBool DISCEndpointDiscoveryPlugin_removeRemoteReader( struct DISCEndpointDiscoveryPlugin *me, int *failReason, const struct MIGRtpsGuid *guid, const struct DISCSourceInfo *sourceInfo, struct REDAWorker *worker); /*e \ingroup DISCPluggableEndpointModule * * @see DISCEndpointDiscoveryPlugin_removeRemoteWritersByCookie */ extern DISCDllExport RTIBool DISCEndpointDiscoveryPlugin_removeRemoteReadersByCookie( struct DISCEndpointDiscoveryPlugin *me, int *failReason, const struct DISCCookieHandle *cookieHandle, const struct DISCSourceInfo *sourceInfo, struct REDAWorker *worker); /*------------------------------------------------------------------------------ * ENDPOINT DISCOVERY OTHER FUNCTIONS * ---------------------------------------------------------------------------*/ /*e \ingroup DISCPluggableParticipantModule * \brief Gets the userData associated with an endpoint discover plugin. * * @param me \b In. Self. */ extern DISCDllExport void *DISCEndpointDiscoveryPlugin_getUserData( struct DISCEndpointDiscoveryPlugin *me); /*e \ingroup DISCPluggableParticipantModule * \brief Sets the userData associated with an endpoint discover plugin. * * @param me \b In. Self. * @param userData \b In. User data. */ extern DISCDllExport void DISCEndpointDiscoveryPlugin_setUserData( struct DISCEndpointDiscoveryPlugin *me, void *userData); /*e \ingroup DISCPluggableParticipantModule * \brief Resumes the endpoint discovery for the specified remote participant. * * @param me \b In. Self. */ extern DISCDllExport RTIBool DISCPluginManager_resumeEndpointDiscovery( struct DISCPluginManager *me, struct MIGRtpsGuid *participantGuid, struct REDAWorker *worker); /*e \ingroup DISCPluggableParticipantModule * \brief Get the number of registered endpoint discovery plugins. Returns -1 * if an error happens. * * @param me \b In. Self. */ extern DISCDllExport int DISCPluginManager_getNumberOfEndpointPlugins( struct DISCPluginManager *self); #ifdef __cplusplus } /* extern "C" */ #endif #include "disc/disc_pluggable_impl.h" #endif /* disc_pluggable_h */