Send modules list into to Notification server
Send modules list into to Notification server TODO: remove fprintf in module_feedback_send and use log manager instead
This commit is contained in:
@ -30,12 +30,15 @@
|
||||
* 07/05/14 Massimiliano Pinto Added version_string to global configuration
|
||||
* 23/05/14 Massimiliano Pinto Added id to global configuration
|
||||
* 17/10/14 Mark Riddoch Added poll tuning configuration parameters
|
||||
* 05/03/15 Massimiliano Pinto Added sysname, release, sha1_mac to gateway struct
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
|
||||
#define DEFAULT_NBPOLLS 3 /**< Default number of non block polls before we block */
|
||||
#define DEFAULT_POLLSLEEP 1000 /**< Default poll wait time (milliseconds) */
|
||||
#define _SYSNAME_STR_LENGTH 256 /**< sysname len */
|
||||
#define _RELEASE_STR_LENGTH 256 /**< release len */
|
||||
/**
|
||||
* Maximum length for configuration parameter value.
|
||||
*/
|
||||
@ -92,11 +95,12 @@ typedef struct config_context {
|
||||
* The gateway global configuration data
|
||||
*/
|
||||
typedef struct {
|
||||
int n_threads; /**< Number of polling threads */
|
||||
char *version_string; /**< The version string of embedded database library */
|
||||
char release_string[256]; /**< The release name string of the system */
|
||||
char mac_sha1[SHA_DIGEST_LENGTH]; /*< The SHA1 digest of an interface MAC address */
|
||||
unsigned long id; /**< MaxScale ID */
|
||||
int n_threads; /**< Number of polling threads */
|
||||
char *version_string; /**< The version string of embedded database library */
|
||||
char release_string[_SYSNAME_STR_LENGTH]; /**< The release name string of the system */
|
||||
char sysname[_SYSNAME_STR_LENGTH]; /**< The release name string of the system */
|
||||
uint8_t mac_sha1[SHA_DIGEST_LENGTH]; /*< The SHA1 digest of an interface MAC address */
|
||||
unsigned long id; /**< MaxScale ID */
|
||||
unsigned int n_nbpoll; /**< Tune number of non-blocking polls */
|
||||
unsigned int pollsleep; /**< Wait time in blocking polls */
|
||||
} GATEWAY_CONF;
|
||||
@ -109,7 +113,7 @@ extern unsigned int config_pollsleep();
|
||||
CONFIG_PARAMETER* config_get_param(CONFIG_PARAMETER* params, const char* name);
|
||||
config_param_type_t config_get_paramtype(CONFIG_PARAMETER* param);
|
||||
CONFIG_PARAMETER* config_clone_param(CONFIG_PARAMETER* param);
|
||||
|
||||
extern int config_truth_value(char *);
|
||||
bool config_set_qualified_param(
|
||||
CONFIG_PARAMETER* param,
|
||||
void* val,
|
||||
@ -133,4 +137,7 @@ bool config_get_valtarget(
|
||||
CONFIG_PARAMETER* param,
|
||||
const char* name, /*< if NULL examine current param only */
|
||||
config_param_type_t ptype);
|
||||
|
||||
void config_enable_feedback_task(void);
|
||||
void config_disable_feedback_task(void);
|
||||
#endif
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#ifndef _NOTIFICATION_H
|
||||
#define _NOTIFICATION_H
|
||||
#ifndef _NOTIFICATION_SERVICE_H
|
||||
#define _NOTIFICATION_SERVICE_H
|
||||
/*
|
||||
* This file is distributed as part of the MariaDB Corporation MaxScale. It is free
|
||||
* software: you can redistribute it and/or modify it under the terms of the
|
||||
@ -32,6 +32,12 @@
|
||||
* @endverbatim
|
||||
*/
|
||||
|
||||
#define _NOTIFICATION_CONNECT_TIMEOUT 30
|
||||
#define _NOTIFICATION_OPERATION_TIMEOUT 30
|
||||
#define _NOTIFICATION_SEND_PENDING 0
|
||||
#define _NOTIFICATION_SEND_OK 1
|
||||
#define _NOTIFICATION_SEND_ERROR 2
|
||||
|
||||
/**
|
||||
* The configuration and usage information data for feeback service
|
||||
*/
|
||||
@ -39,14 +45,15 @@
|
||||
typedef struct {
|
||||
int feedback_enable; /**< Enable/Disable Notification feedback */
|
||||
char *feedback_url; /**< URL to which the data is sent */
|
||||
char *feedback_setup_info; /**< MaxScale setup identifier info included in the feedback data sent */
|
||||
char *feedback_user_info; /**< User info included in the feedback data sent */
|
||||
int feedback_timeout; /**< An attempt to write/read the data times out and fails after this many seconds */
|
||||
int feedback_connect_timeout; /**< An attempt to send the data times out and fails after this many seconds */
|
||||
int feedback_last_action; /**< Holds the feedback last send action status */
|
||||
char *release_info; /**< Operating system Release name */
|
||||
char *sysname; /**< Operating system name */
|
||||
uint8_t *mac_sha1; /**< First available MAC address*/
|
||||
} FEEDBACK_CONF;
|
||||
|
||||
|
||||
extern FEEDBACK_CONF* notification_get_config_feedback();
|
||||
|
||||
extern char *gw_bin2hex(char *out, const uint8_t *in, unsigned int len);
|
||||
extern void gw_sha1_str(const uint8_t *in, int in_len, uint8_t *out);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user