Source
static void compare_trap(const char *date, const char *trap, int snmp_timestamp, const char *snmp_id_bin, int *skip)
/*
** 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/>.
**/
static int trap_fd = -1;
static off_t trap_lastsize;
static ino_t trap_ino = 0;
static char *buffer = NULL;
static int offset = 0;
static int force = 0;
static void db_update_lastsize(void)
{
zbx_db_begin();
zbx_db_execute("update globalvars set value=" ZBX_FS_I64 " where name='snmp_lastsize'",
(zbx_int64_t)trap_lastsize);
zbx_db_commit();
}
/******************************************************************************
* *
* Purpose: adds trap to all matching items for specified interface *
* *
* Return value: SUCCEED - matching item was found *
* FAIL - no matching item was found (including fallback items) *
* *
******************************************************************************/
static int process_trap_for_interface(zbx_uint64_t interfaceid, char *trap, zbx_timespec_t *ts)
{
zbx_dc_item_t *items = NULL;
const char *regex;