eb087e9e78b5f41470a8973f058c9139f9c57973
[strongswan.git] / src / libcharon / plugins / tnccs_20 / messages / pb_pa_msg.h
1 /*
2 * Copyright (C) 2010 Andreas Steffen
3 * HSR Hochschule fuer Technik Rapperswil
4 *
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>.
9 *
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
13 * for more details.
14 */
15
16 /**
17 * @defgroup pb_pa_msg pb_pa_msg
18 * @{ @ingroup tnccs_20
19 */
20
21 #ifndef PB_PA_MSG_H_
22 #define PB_PA_MSG_H_
23
24 typedef struct pb_pa_msg_t pb_pa_msg_t;
25
26 #include "pb_tnc_msg.h"
27
28 /**
29 * Class representing the PB-PA message type.
30 */
31 struct pb_pa_msg_t {
32
33 /**
34 * PB-TNC Message interface
35 */
36 pb_tnc_msg_t pb_interface;
37
38 /**
39 * Get PA Message Vendor ID and Subtype
40 *
41 * @param subtype PA Subtype
42 * @return PA Message Vendor ID
43 */
44 u_int32_t (*get_vendor_id)(pb_pa_msg_t *this, u_int32_t *subtype);
45
46 /**
47 * Get Posture Collector ID
48 *
49 * @return Posture Collector ID
50 */
51 u_int16_t (*get_collector_id)(pb_pa_msg_t *this);
52
53 /**
54 * Get Posture Validator ID
55 *
56 * @return Posture Validator ID
57 */
58 u_int16_t (*get_validator_id)(pb_pa_msg_t *this);
59
60 /**
61 * Get the PA Message Body
62 *
63 * @return PA Message Body
64 */
65 chunk_t (*get_body)(pb_pa_msg_t *this);
66
67 /**
68 * Get the exclusive flag
69 *
70 * @return exclusive flag
71 */
72 bool (*get_exclusive_flag)(pb_pa_msg_t *this);
73
74 /**
75 * Set the exclusive flag
76 *
77 * @param excl vexclusive flag
78 */
79 void (*set_exclusive_flag)(pb_pa_msg_t *this, bool excl);
80 };
81
82 /**
83 * Create a PB-PA message from parameters
84 *
85 * @param vendor_id PA Message Vendor ID
86 * @param subtype PA Subtype
87 * @param collector_id Posture Collector ID
88 * @param validator_id Posture Validator ID
89 * @param msg_body PA Message Body
90 */
91 pb_tnc_msg_t *pb_pa_msg_create(u_int32_t vendor_id, u_int32_t subtype,
92 u_int16_t collector_id, u_int16_t validator_id,
93 chunk_t msg_body);
94
95 /**
96 * Create an unprocessed PB-PA message from raw data
97 *
98 * @param data PB-PA message data
99 */
100 pb_tnc_msg_t* pb_pa_msg_create_from_data(chunk_t data);
101
102 #endif /** PB_PA_MSG_H_ @}*/