X-Git-Url: https://git.strongswan.org/?p=strongswan.git;a=blobdiff_plain;f=src%2Fcharon%2Fencoding%2Fparser.h;h=23049243846d05ccf73815e07f7cbf23dc7cf5ae;hp=216fac9b740ac495994ea2289435c7356cee7d27;hb=a09d1c386af714974c69b5b9dc658cebfea3a886;hpb=b8577029d1d37b798907f0418ddb1445e13c3c44 diff --git a/src/charon/encoding/parser.h b/src/charon/encoding/parser.h index 216fac9..2304924 100644 --- a/src/charon/encoding/parser.h +++ b/src/charon/encoding/parser.h @@ -1,12 +1,6 @@ -/** - * @file parser.h - * - * @brief Interface of parser_t. - * - */ - /* - * Copyright (C) 2005 Jan Hutter, Martin Willi + * Copyright (C) 2005-2006 Martin Willi + * Copyright (C) 2005 Jan Hutter * Hochschule fuer Technik Rapperswil * * This program is free software; you can redistribute it and/or modify it @@ -20,76 +14,66 @@ * for more details. */ +/** + * @defgroup parser parser + * @{ @ingroup encoding + */ + #ifndef PARSER_H_ #define PARSER_H_ -#include +typedef struct parser_t parser_t; + +#include #include #include - -typedef struct parser_t parser_t; - /** - * @brief A parser_t class to parse IKEv2 payloads. - * + * A parser_t class to parse IKEv2 payloads. + * * A parser is used for parsing one chunk of data. Multiple * payloads can be parsed out of the chunk using parse_payload. * The parser remains the state until destroyed. - * - * @b Constructors: - * - parser_create() - * - * @ingroup encoding */ struct parser_t { /** - * @brief Parses the next payload. + * Parses the next payload. * * @warning Caller is responsible for freeing allocated payload. * * Rules for parsing are described in the payload definition. * - * @param this parser_t bject - * @param payload_type payload type to parse - * @param[out] payload pointer where parsed payload was allocated + * @param payload_type payload type to parse + * @param payload pointer where parsed payload was allocated * @return - * - SUCCESSFUL if succeeded, - * - PARSE_ERROR if corrupted/invalid data found + * - SUCCESSFUL if succeeded, + * - PARSE_ERROR if corrupted/invalid data found */ status_t (*parse_payload) (parser_t *this, payload_type_t payload_type, payload_t **payload); /** * Gets the remaining byte count which is not currently parsed. - * - * @param parser parser_t object */ int (*get_remaining_byte_count) (parser_t *this); /** - * @brief Resets the current parser context. - * - * @param parser parser_t object + * Resets the current parser context. */ void (*reset_context) (parser_t *this); /** - * @brief Destroys a parser_t object. - * - * @param parser parser_t object + * Destroys a parser_t object. */ void (*destroy) (parser_t *this); }; /** - * @brief Constructor to create a parser_t object. - * - * @param data chunk of data to parse with this parser_t object - * @return parser_t object + * Constructor to create a parser_t object. * - * @ingroup encoding + * @param data chunk of data to parse with this parser_t object + * @return parser_t object */ parser_t *parser_create(chunk_t data); -#endif /*PARSER_H_*/ +#endif /** PARSER_H_ @}*/