Simplify signature of get_encoding_rules(), make all rules static

This commit is contained in:
Martin Willi
2012-03-20 17:30:42 +01:00
parent 683d83ed3e
commit e9b55b8325
26 changed files with 114 additions and 137 deletions
+2 -3
View File
@@ -363,11 +363,10 @@ METHOD(parser_t, parse_payload, status_t,
{
payload_t *pld;
void *output;
size_t rule_count;
int payload_length = 0, spi_size = 0, attribute_length = 0;
u_int16_t ts_type = 0;
bool attribute_format = FALSE;
int rule_number;
int rule_number, rule_count;
encoding_rule_t *rule;
/* create instance of the payload to parse */
@@ -383,7 +382,7 @@ METHOD(parser_t, parse_payload, status_t,
output = pld;
/* parse the payload with its own rulse */
pld->get_encoding_rules(pld, &this->rules, &rule_count);
rule_count = pld->get_encoding_rules(pld, &this->rules);
for (rule_number = 0; rule_number < rule_count; rule_number++)
{
rule = &(this->rules[rule_number]);