open-vm-tools 12.5.0
ToolsAppProvider Struct Reference

#include <plugin.h>

Data Fields

const gchar * name
 
ToolsAppType regType
 
size_t regSize
 
void(* activate )(ToolsAppCtx *ctx, struct ToolsAppProvider *prov, GError **err)
 
gboolean(* registerApp )(ToolsAppCtx *ctx, struct ToolsAppProvider *prov, struct ToolsPluginData *plugin, gpointer reg)
 
void(* shutdown )(ToolsAppCtx *ctx, struct ToolsAppProvider *prov)
 
void(* dumpState )(ToolsAppCtx *ctx, struct ToolsAppProvider *prov, gpointer reg)
 

Detailed Description

Defines the registration data for an "application provider". Application providers allow plugins to hook into new application frameworks that will be then managed by vmtoolsd - for example, an HTTP server or a dbus endpoint.

Application providers will be loaded during startup but not activated until at least one plugin provides registration data for that provider.

Field Documentation

◆ activate

void(* ToolsAppProvider::activate) (ToolsAppCtx *ctx, struct ToolsAppProvider *prov, GError **err)

Activation callback (optional). This is called when vmtoolsd detects that there is at least one application that needs to be registered with this provider.

Parameters
[in]ctxThe application context.
[in]provThe provider instance.
[out]errWhere to store any error information.

◆ dumpState

void(* ToolsAppProvider::dumpState) (ToolsAppCtx *ctx, struct ToolsAppProvider *prov, gpointer reg)

Debugging callback (optional). This callback is called when dumping the service state to the logs for debugging purposes.

This callback is called once with a "NULL" reg, so that the provider can log its internal state, and then once for each registration struct provided by loaded plugins.

Parameters
[in]ctxThe application context.
[in]provThe provider instance.
[in]regThe application registration data.

◆ name

const gchar* ToolsAppProvider::name

A name describing the provider.

◆ registerApp

gboolean(* ToolsAppProvider::registerApp) (ToolsAppCtx *ctx, struct ToolsAppProvider *prov, struct ToolsPluginData *plugin, gpointer reg)

Registration callback. This is called after "activate", to register an application provided by a plugin.

Parameters
[in]ctxThe application context.
[in]provThe provider instance.
[in]pluginThe plugin that owns the registration.
[in]regThe application registration data.
Returns
Whether registration succeeded.

◆ regSize

size_t ToolsAppProvider::regSize

Size of the registration structure for this provider.

◆ regType

ToolsAppType ToolsAppProvider::regType

Application type. Optimally, new providers would request a new type to be added to the "official" ToolsAppType enum declared above, although that is not strictly necessary. Providers should at least try to choose an unused value.

◆ shutdown

void(* ToolsAppProvider::shutdown) (ToolsAppCtx *ctx, struct ToolsAppProvider *prov)

Shutdown callback (optional). Called when the service is being shut down. The provider is responsible for keeping track of registrations and cleaning them up during shutdown.

This method is only called if the provider was successfully activated.

Parameters
[in]ctxThe application context.
[in]provThe provider instance.

The documentation for this struct was generated from the following file: