Source
static void rtc_notify_service(zbx_rtc_sub_t *sub, zbx_uint32_t code, const unsigned char *data, zbx_uint32_t size)
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
ZBX_PTR_VECTOR_IMPL(rtc_sub, zbx_rtc_sub_t *)
ZBX_PTR_VECTOR_IMPL(rtc_hook, zbx_rtc_hook_t *)
/******************************************************************************
* *
* Purpose: get runtime control option targets *
* *
******************************************************************************/
int zbx_rtc_get_command_target(const char *data, pid_t *pid, int *proc_type, int *proc_num, int *scope,
char **result)
{
struct zbx_json_parse jp;
char buf[MAX_STRING_LEN];
if (FAIL == zbx_json_open(data, &jp))
{
*result = zbx_dsprintf(NULL, "Invalid parameters \"%s\"\n", data);
return FAIL;
}
if (NULL != scope)
{
if (SUCCEED == zbx_json_value_by_name(&jp, ZBX_PROTO_TAG_SCOPE, buf, sizeof(buf), NULL))
*scope = atoi(buf);
else
*scope = ZBX_PROF_UNKNOWN;
}
if (SUCCEED == zbx_json_value_by_name(&jp, ZBX_PROTO_TAG_PID, buf, sizeof(buf), NULL))
{
zbx_uint64_t pid_ui64;
if (SUCCEED != zbx_is_uint64(buf, &pid_ui64) || 0 == pid_ui64)
{