All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions
Turbulence Support : support functions and useful APIs

Functions

char * turbulence_support_get_backtrace (TurbulenceCtx *ctx, int pid)
 
axl_bool turbulence_support_simple_smtp_send (TurbulenceCtx *ctx, const char *smtp_conf_id, const char *subject, const char *body, const char *body_file)
 
axl_bool turbulence_support_smtp_send (TurbulenceCtx *ctx, const char *mail_from, const char *mail_to, const char *subject, const char *body, const char *body_file, const char *smtp_server, const char *smtp_port)
 

Detailed Description

Function Documentation

char* turbulence_support_get_backtrace ( TurbulenceCtx ctx,
int  pid 
)

Allows to get process backtrace (including all threads) of the given process id.

Parameters
ctxThe context where the operation is implemented.
pidThe process id for which the backtrace is requested. Use getpid () to get current process id.
Returns
A newly allocated string containing the path to the file where the backtrace was generated or NULL if it fails.

References error, msg, turbulence_runtime_datadir(), and turbulence_runtime_tmpdir().

axl_bool turbulence_support_simple_smtp_send ( TurbulenceCtx ctx,
const char *  smtp_conf_id,
const char *  subject,
const char *  body,
const char *  body_file 
)

Allows to send a SMTP message using the configuration found on the provided smtp_conf declaration.

This smtp_conf declaration is found at the turbulence configuration file. See 2.4 Receiving SMTP notification on failures and error conditions

Parameters
ctxThe turbulence context where the operation will be implemented.
smtp_conf_idThe string identifying the smtp configuration (id declaration inside <smtp-server> node) or NULL. If NULL is used, then the first smtp server with is-default=yes declared is used.
subjectOptional subject to be configured on mail body message.
bodyThe message body to be configured. If NULL is provided no body will be sent.
body_fileOptional reference to a file that contains the body of the message.
Returns
axl_true if the mail message was submited or axl_false if something failed.

References error, turbulence_config_get(), and turbulence_support_smtp_send().

axl_bool turbulence_support_smtp_send ( TurbulenceCtx ctx,
const char *  mail_from,
const char *  mail_to,
const char *  subject,
const char *  body,
const char *  body_file,
const char *  smtp_server,
const char *  smtp_port 
)

Allows to send a mail message through the provided smtp server and port, with the provided content.

Parameters
ctxThe context where the operation will take place.
mail_fromThe mail from value to configure on this mail message. If NULL is provided, "turbulence@localdomain.local" will be used.
mail_toThe destination address value to configure on this mail message. This value is not optional and must be defined and pointing to a right account.
subjectThe message subject to be configured. This value is optional, if not configured no subject will be placed.
bodyThe message body to be configured. This value is optional, if not configured no subject will be placed.
body_fileOptional reference to a file that contains the body of the message.
smtp_serverThe location of the smtp server. If NULL is passed, localhost will be used.
smtp_portThe port location of the smtp server. If NULL is passed, 25 will be used.
Returns
axl_true in the case the mail message was successfully sent otherwise axl_false is returned.

References error, msg, and TBC_VORTEX_CTX.

Referenced by turbulence_support_simple_smtp_send().