FreeBSD/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c
/*
 * In case of a getbulk PDU, the error_status and error_index fields are used by
 * libbsnmp to hold the values of the non-repeaters and max-repetitions fields
 * that are present only in the getbulk - so before sending the PDU make sure
 * these have correct values as well.
 */
In case of a getbulk PDU, the error_status and error_index fields are used by
libbsnmp to hold the values of the non-repeaters and max-repetitions fields
that are present only in the getbulk - so before sending the PDU make sure
these have correct values as well.
In case of a getbulk PDU the error_status and error_index fields are used by libbsnmp to hold the values of the non - repeaters and max - repetitions fields that are present only in the getbulk - so before sending the PDU make sure these have correct values as well .
static void
snmpget_fix_getbulk(struct snmp_pdu *pdu, uint32_t max_rep, uint32_t non_rep)
{
	assert(pdu != NULL);
	if (pdu->nbindings < non_rep)
		pdu->error_status = pdu->nbindings;
	else
		pdu->error_status = non_rep;
	if (max_rep > 0)
		pdu->error_index = max_rep;
	else
		pdu->error_index = 1;
}
static void snmpget_fix_getbulk ( struct snmp_pdu * pdu , uint32_t max_rep , uint32_t non_rep ) { assert ( pdu != NULL ) ; if ( pdu -> nbindings < non_rep ) pdu -> error_status = pdu -> nbindings ; else pdu -> error_status = non_rep ; if ( max_rep > 0 ) pdu -> error_index = max_rep ; else pdu -> error_index = 1 ; }
In case of a getbulk PDU, the error_status and error_index fields are used by
 libbsnmp to hold the values of the non-repeaters and max-repetitions fields
 that are present only in the getbulk - so before sending the PDU make sure
 these have correct values as well.
In case of a getbulk PDU the error_status and error_index fields are used by libbsnmp to hold the values of the non - repeaters and max - repetitions fields that are present only in the getbulk - so before sending the PDU make sure these have correct values as well .