From 2d92d87f40915ac8f4f7982595455bdc81f49bd5 Mon Sep 17 00:00:00 2001 From: Joerg Deckert Date: Thu, 23 Jan 2025 15:06:40 +0100 Subject: [PATCH] additional adjustments for Zabbix 7.x --- source/modules/lldp_get.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/source/modules/lldp_get.c b/source/modules/lldp_get.c index f9c4034..b16a3d0 100644 --- a/source/modules/lldp_get.c +++ b/source/modules/lldp_get.c @@ -24,6 +24,7 @@ #include "zbxsysinfo.h" #include "zbxalgo.h" #include "zbxjson.h" +#include "zbxstr.h" #define SNMP_NO_DEBUGGING /* disabling debugging messages from Net-SNMP library */ @@ -1096,7 +1097,7 @@ int lldpmod_snmpwalk_getrem_cb(void *arg, const netsnmp_variable_list *var) { char **msg; - msg = GET_MSG_RESULT(getrem_data->result); + msg = ZBX_GET_MSG_RESULT(getrem_data->result); zabbix_log(LOG_LEVEL_DEBUG, "%s: cannot get index='%lu', rem_index='%lu' value: %s", MODULE_NAME, (unsigned long)getrem_data->index, (unsigned long)getrem_data->rem_index, NULL != msg && NULL != *msg ? *msg : "(null)"); @@ -1149,9 +1150,9 @@ int lldpmod_snmpwalk_discovery_cb(void *arg, const netsnmp_variable_list *var) return ret; } - init_result(&snmp_result); + zbx_init_agent_result(&snmp_result); if (SUCCEED == lldpmod_snmp_set_result(var, &snmp_result, data->request.res_types[data->num], data->request.dump_flags[data->num]) && - NULL != GET_STR_RESULT(&snmp_result)) + NULL != ZBX_GET_STR_RESULT(&snmp_result)) { if (NULL == (obj = (lldpmod_snmp_object_t *)zbx_hashset_search(&data->objects, &index))) { @@ -1222,7 +1223,7 @@ int lldpmod_snmpwalk_discovery_cb(void *arg, const netsnmp_variable_list *var) else { char **msg; - msg = GET_MSG_RESULT(&snmp_result); + msg = ZBX_GET_MSG_RESULT(&snmp_result); if (data->request.key_types[data->num] == KEY_TYPE_LOC) zabbix_log(LOG_LEVEL_DEBUG, "%s: cannot get index '%lu' string value: %s", MODULE_NAME, (unsigned long)index, NULL != msg && NULL != *msg ? *msg : "(null)"); @@ -1232,7 +1233,7 @@ int lldpmod_snmpwalk_discovery_cb(void *arg, const netsnmp_variable_list *var) } - free_result(&snmp_result); + zbx_free_agent_result(&snmp_result); return ret; } @@ -1595,7 +1596,7 @@ exit: } char **msg; - msg = GET_MSG_RESULT(result); + msg = ZBX_GET_MSG_RESULT(result); zabbix_log(LOG_LEVEL_DEBUG, "%s: getting SNMP values failed: %s", MODULE_NAME, NULL != msg && NULL != *msg ? *msg : "(null)"); ret = SYSINFO_RET_FAIL; @@ -1846,7 +1847,7 @@ exit: } char **msg; - msg = GET_MSG_RESULT(result); + msg = ZBX_GET_MSG_RESULT(result); zabbix_log(LOG_LEVEL_DEBUG, "%s: getting SNMP values failed: %s", MODULE_NAME, NULL != msg && NULL != *msg ? *msg : "(null)"); ret = SYSINFO_RET_FAIL;