FreeBSD/contrib/bsnmp/snmpd/main.c
/*
 * Consume a message from the input buffer
 */
Consume a message from the input buffer
Consume a message from the input buffer
static void
snmp_input_consume(struct port_input *pi)
{
	if (!pi->stream) {
		pi->length = 0;
		return;
	}
	if (pi->consumed >= pi->length) {
		pi->length = 0;
		return;
	}
	memmove(pi->buf, pi->buf + pi->consumed, pi->length - pi->consumed);
	pi->length -= pi->consumed;
}
static void snmp_input_consume ( struct port_input * pi ) { if ( ! pi -> stream ) { pi -> length = 0 ; return ; } if ( pi -> consumed >= pi -> length ) { pi -> length = 0 ; return ; } memmove ( pi -> buf , pi -> buf + pi -> consumed , pi -> length - pi -> consumed ) ; pi -> length -= pi -> consumed ; }
Consume a message from the input buffer
Consume a message from the input buffer
/* always consume everything */ /* all bytes consumed */