use pen_type_t for PA Message Subtype
[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 #include <pen/pen.h>
29
30 /**
31 * Class representing the PB-PA message type.
32 */
33 struct pb_pa_msg_t {
34
35 /**
36 * PB-TNC Message interface
37 */
38 pb_tnc_msg_t pb_interface;
39
40 /**
41 * Get PA Message Vendor ID and Subtype
42 *
43 * @return Vendor-specific PA Subtype
44 */
45 pen_type_t (*get_subtype)(pb_pa_msg_t *this);
46
47 /**
48 * Get Posture Collector ID
49 *
50 * @return Posture Collector ID
51 */
52 u_int16_t (*get_collector_id)(pb_pa_msg_t *this);
53
54 /**
55 * Get Posture Validator ID
56 *
57 * @return Posture Validator ID
58 */
59 u_int16_t (*get_validator_id)(pb_pa_msg_t *this);
60
61 /**
62 * Get the PA Message Body
63 *
64 * @return PA Message Body
65 */
66 chunk_t (*get_body)(pb_pa_msg_t *this);
67
68 /**
69 * Get the exclusive flag
70 *
71 * @return exclusive flag
72 */
73 bool (*get_exclusive_flag)(pb_pa_msg_t *this);
74
75 };
76
77 /**
78 * Create a PB-PA message from parameters
79 *
80 * @param vendor_id PA Message Vendor ID
81 * @param subtype PA Subtype
82 * @param collector_id Posture Collector ID
83 * @param validator_id Posture Validator ID
84 * @param excl Exclusive Flag
85 * @param msg_body PA Message Body
86 */
87 pb_tnc_msg_t *pb_pa_msg_create(u_int32_t vendor_id, u_int32_t subtype,
88 u_int16_t collector_id, u_int16_t validator_id,
89 bool excl, chunk_t msg_body);
90
91 /**
92 * Create an unprocessed PB-PA message from raw data
93 *
94 * @param data PB-PA message data
95 */
96 pb_tnc_msg_t* pb_pa_msg_create_from_data(chunk_t data);
97
98 #endif /** PB_PA_MSG_H_ @}*/