65
* Parse a 4-Bit unsigned integer from the current parsing position.
67
* @param this parser_t object
68
* @param rule_number number of current rule
69
* @param[out] output_pos pointer where to write the parsed result
72
* - PARSE_ERROR when not successful
74
status_t (*parse_uint4) (private_parser_t *this, int rule_number, u_int8_t *output_pos);
77
* Parse a 8-Bit unsigned integer from the current parsing position.
79
* @param this parser_t object
80
* @param rule_number number of current rule
81
* @param[out] output_pos pointer where to write the parsed result
84
* - PARSE_ERROR when not successful
86
status_t (*parse_uint8) (private_parser_t *this, int rule_number, u_int8_t *output_pos);
89
* Parse a 15-Bit unsigned integer from the current parsing position.
91
* This is a special case used for ATTRIBUTE_TYPE.
92
* Big-/Little-endian conversion is done here.
94
* @param this parser_t object
95
* @param rule_number number of current rule
96
* @param[out] output_pos pointer where to write the parsed result
99
* - PARSE_ERROR when not successful
101
status_t (*parse_uint15) (private_parser_t *this, int rule_number, u_int16_t *output_pos);
104
* Parse a 16-Bit unsigned integer from the current parsing position.
106
* Big-/Little-endian conversion is done here.
108
* @param this parser_t object
109
* @param rule_number number of current rule
110
* @param[out] output_pos pointer where to write the parsed result
113
* - PARSE_ERROR when not successful
115
status_t (*parse_uint16) (private_parser_t *this, int rule_number, u_int16_t *output_pos);
118
* Parse a 32-Bit unsigned integer from the current parsing position.
120
* Big-/Little-endian conversion is done here.
122
* @param this parser_t object
123
* @param rule_number number of current rule
124
* @param[out] output_pos pointer where to write the parsed result
127
* - PARSE_ERROR when not successful
129
status_t (*parse_uint32) (private_parser_t *this, int rule_number, u_int32_t *output_pos);
132
* Parse a 64-Bit unsigned integer from the current parsing position.
134
* @todo add support for big-endian machines.
136
* @param this parser_t object
137
* @param rule_number number of current rule
138
* @param[out] output_pos pointer where to write the parsed result
141
* - PARSE_ERROR when not successful
143
status_t (*parse_uint64) (private_parser_t *this, int rule_number, u_int64_t *output_pos);
146
* Parse a given amount of bytes and writes them to a specific location
148
* @param this parser_t object
149
* @param rule_number number of current rule
150
* @param[out] output_pos pointer where to write the parsed result
151
* @param bytes number of bytes to parse
154
* - PARSE_ERROR when not successful
156
status_t (*parse_bytes) (private_parser_t *this, int rule_number, u_int8_t *output_pos,size_t bytes);
159
* Parse a single Bit from the current parsing position
161
* @param this parser_t object
162
* @param rule_number number of current rule
163
* @param[out] output_pos pointer where to write the parsed result
166
* - PARSE_ERROR when not successful
168
status_t (*parse_bit) (private_parser_t *this, int rule_number, bool *output_pos);
171
* Parse substructures in a list
173
* This function calls the parser recursively to parse contained substructures
174
* in a linked_list_t. The list must already be created. Payload defines
175
* the type of the substructures. parsing is continued until the specified length
176
* is completely parsed.
178
* @param this parser_t object
179
* @param rule_number number of current rule
180
* @param[out] output_pos pointer of a linked_list where substructures are added
181
* @param payload_type type of the contained substructures to parse
182
* @param length number of bytes to parse in this list
185
* - PARSE_ERROR when not successful
187
status_t (*parse_list) (private_parser_t *this, int rule_number, linked_list_t **output_pos, payload_type_t payload_ype, size_t length);
190
* Parse data from current parsing position in a chunk.
192
* This function clones length number of bytes to output_pos, without
193
* modifiyng them. Space will be allocated and must be freed by caller.
195
* @param this parser_t object
196
* @param rule_number number of current rule
197
* @param[out] output_pos pointer of a chunk which will point to the allocated data
198
* @param length number of bytes to clone
201
* - PARSE_ERROR when not successful
203
status_t (*parse_chunk) (private_parser_t *this, int rule_number, chunk_t *output_pos, size_t length);
206
65
* Current bit for reading in input data.