Hi Mark, in my application i'm monitoring some variables like a humidity, temperature... and using the snmp for sending traps. In the original code, the part of varbindings was not been implemented. Then I implemented the part of varbindings which I use when the traps are not standards.
My problem is, in the application i've an archive called "controleSNMPv1.c", and in the task fnTaskMonitoramentoSNMP only in the first iteration I send the coldstart trap like this:
void fnTaskMonitoramentoSNMP(TTASKTABLE * ptrTaskTable )
{
static unsigned char startTask = 0;
if(startTask == 0)
{
fnGenerateTrap(SNMP_COLDSTART, 0, 0, 0);
startTask++;
}
:
:
}
When I capture the traps in Wireshark, sometimes many of coldstart traps are sent. Why many of coldstart traps are sent if this is the only reference to coldstart trap in my code?
OBS: How i said, in the original code, the part of varbindings was not been implemented. Then I implemented the part of varbindings which I use when the traps are not standards. So the header of my fnGenerateTrap is:
int fnGenerateTrap(unsigned char ucTrap, unsigned char ucSpecificCode, unsigned char *varBinding, unsigned char tamanho);
Where "*varBinding" is a pointer to the array of virBindings and "tamanho" is the size of this array.
Best Regards,
Marcel.