+static status_t parse_bytes (private_parser_t *this, int rule_number, u_int8_t *output_pos,size_t bytes)
+{
+ if (this->byte_pos + bytes > this->input_roof)
+ {
+ this->logger->log(this->logger, ERROR, " not enough input to parse rule %d %s",
+ rule_number, mapping_find(encoding_type_m, this->rules[rule_number].type));
+ return PARSE_ERROR;
+ }
+ if (this->bit_pos)
+ {
+ this->logger->log(this->logger, ERROR, " found rule %d %s on bitpos %d",
+ rule_number, mapping_find(encoding_type_m, this->rules[rule_number].type),
+ this->bit_pos);
+ return PARSE_ERROR;
+ }
+
+ /* caller interested in result ? */
+ if (output_pos != NULL)
+ {
+ memcpy(output_pos,this->byte_pos,bytes);
+
+ this->logger->log_bytes(this->logger, RAW|MOST, " =>", (void*)output_pos, bytes);
+ }
+ this->byte_pos += bytes;
+
+ return SUCCESS;
+}
+