2 * Copyright (C) 2010 Andreas Steffen
3 * HSR Hochschule fuer Technik Rapperswil
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 * @defgroup tnccs_msg tnccs_msg
18 * @{ @ingroup tnccs_11
24 typedef enum tnccs_msg_type_t tnccs_msg_type_t
;
25 typedef struct tnccs_msg_t tnccs_msg_t
;
28 #include <collections/linked_list.h>
29 #include <libxml/parser.h>
32 * TNCC-TNCS messages as defined in section 2.8.5 of TCG TNC IF-TNCCS v1.2
34 enum tnccs_msg_type_t
{
36 TNCCS_MSG_RECOMMENDATION
= 1,
38 TNCCS_MSG_PREFERRED_LANGUAGE
= 3,
39 TNCCS_MSG_REASON_STRINGS
= 4,
40 TNCCS_MSG_TNCS_CONTACT_INFO
= 5,
45 * enum name for tnccs_msg_type_t.
47 extern enum_name_t
*tnccs_msg_type_names
;
50 * Generic interface for all TNCCS message types.
52 * To handle all messages in a generic way, this interface
53 * must be implemented by each message type.
58 * Get the TNCCS Message Type
60 * @return TNCCS Message Type
62 tnccs_msg_type_t (*get_type
)(tnccs_msg_t
*this);
65 * Get the XML-encoded Message Node
67 * @return Message Node
69 xmlNodePtr (*get_node
)(tnccs_msg_t
*this);
72 * Process the TNCCS Message
74 * @return return processing status
76 status_t (*process
)(tnccs_msg_t
*this);
79 * Get a new reference to the message.
81 * @return this, with an increased refcount
83 tnccs_msg_t
* (*get_ref
)(tnccs_msg_t
*this);
86 * Destroys a tnccs_msg_t object.
88 void (*destroy
)(tnccs_msg_t
*this);
92 * Create a pre-processed TNCCS message
94 * Useful for the parser which wants a generic constructor for all
97 * @param node TNCCS message node
98 * @param errors linked list of TNCCS error messages
100 tnccs_msg_t
* tnccs_msg_create_from_node(xmlNodePtr node
, linked_list_t
*errors
);
102 #endif /** TNCCS_MSG_H_ @}*/