case U_INT_4:
number_of_bits = 4;
break;
- case TS_TYPE:
case RESERVED_BYTE:
case SPI_SIZE:
case U_INT_8:
}
break;
}
- case TS_TYPE:
case RESERVED_BYTE:
case SPI_SIZE:
case U_INT_8:
case IKE_SPI:
case RESERVED_BYTE:
case SPI_SIZE:
- case TS_TYPE:
case ATTRIBUTE_TYPE:
case ATTRIBUTE_LENGTH:
generate_u_int_type(this, rules[i].type, rules[i].offset);
this->header_length_offset = get_offset(this);
generate_u_int_type(this, U_INT_32, rules[i].offset);
break;
- case ADDRESS:
case SPI:
case CHUNK_DATA:
case ENCRYPTED_DATA:
payload_t *pld;
void *output;
int payload_length = 0, spi_size = 0, attribute_length = 0, header_length;
- uint16_t ts_type = 0;
bool attribute_format = FALSE;
int rule_number, rule_count;
encoding_rule_t *rule;
}
break;
}
- case TS_TYPE:
- {
- if (!parse_uint8(this, rule_number, output + rule->offset))
- {
- pld->destroy(pld);
- return PARSE_ERROR;
- }
- ts_type = *(uint8_t*)(output + rule->offset);
- break;
- }
- case ADDRESS:
- {
- int address_length = (ts_type == TS_IPV4_ADDR_RANGE) ? 4 : 16;
-
- if (!parse_chunk(this, rule_number, output + rule->offset,
- address_length))
- {
- pld->destroy(pld);
- return PARSE_ERROR;
- }
- break;
- }
default:
{
DBG1(DBG_ENC, " no rule to parse rule %d %N",
"ATTRIBUTE_LENGTH_OR_VALUE",
"ATTRIBUTE_LENGTH",
"ATTRIBUTE_VALUE",
- "TS_TYPE",
- "ADDRESS",
"CHUNK_DATA",
"IKE_SPI",
"ENCRYPTED_DATA",
*/
ATTRIBUTE_VALUE,
- /**
- * Representing a Traffic selector type field.
- *
- * When generating it must be changed from host to network order.
- * The value is read from the associated data struct.
- * The current write position is moved 16 bit forward afterwards.
- *
- * When parsing it must be changed from network to host order.
- * The value is written to the associated data struct.
- * The current read pointer is moved 16 bit forward afterwards.
- */
- TS_TYPE,
-
- /**
- * Representing an address field in a traffic selector.
- *
- * Depending on the last field of type TS_TYPE
- * this field is either 4 or 16 byte long.
- *
- * When generating the content of the chunk pointing to
- * is written.
- *
- * When parsing 4 or 16 bytes are read and written into the chunk pointing to.
- */
- ADDRESS,
-
/**
* Representing a variable length byte field.
*/