2 * @file unknown_payload.h
4 * @brief Interface of unknown_payload_t.
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 #ifndef UNKNOWN_PAYLOAD_H_
24 #define UNKNOWN_PAYLOAD_H_
27 #include <encoding/payloads/payload.h>
30 * Header length of the unknown payload.
34 #define UNKNOWN_PAYLOAD_HEADER_LENGTH 4
37 typedef struct unknown_payload_t unknown_payload_t
;
40 * @brief Payload which can't be processed further.
42 * When the parser finds an unknown payload, he builds an instance of
43 * this class. This allows further processing of this payload, such as
44 * a check for the critical bit in the header.
47 * - unknown_payload_create()
51 struct unknown_payload_t
{
54 * The payload_t interface.
56 payload_t payload_interface
;
59 * @brief Get the raw data of this payload, without
60 * the generic payload header.
62 * Returned data are NOT copied and must not be freed.
64 * @param this calling unknown_payload_t object
65 * @return data as chunk_t
67 chunk_t (*get_data
) (unknown_payload_t
*this);
70 * @brief Get the critical flag.
72 * @param this calling unknown_payload_t object
73 * @return TRUE if payload is critical, FALSE if not
75 bool (*is_critical
) (unknown_payload_t
*this);
78 * @brief Destroys an unknown_payload_t object.
80 * @param this unknown_payload_t object to destroy
82 void (*destroy
) (unknown_payload_t
*this);
86 * @brief Creates an empty unknown_payload_t object.
88 * @return unknown_payload_t object
92 unknown_payload_t
*unknown_payload_create(void);
95 #endif /* UNKNOWN_PAYLOAD_H_ */