a472557ca67284e7aa62eadb5a7a7fe8af0ddef0
[strongswan.git] / src / libtnccs / plugins / tnccs_20 / messages / tcg / pb_pdp_referral_msg.h
1 /*
2 * Copyright (C) 2013 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_pdp_referral_msg pb_pdp_referral_msg
18 * @{ @ingroup tnccs_20
19 */
20
21 #ifndef PB_PDP_REFERRAL_MSG_H_
22 #define PB_PDP_REFERRAL_MSG_H_
23
24 typedef enum pb_pdp_identifier_type_t pb_pdp_identifier_type_t;
25 typedef struct pb_pdp_referral_msg_t pb_pdp_referral_msg_t;
26
27 #include "messages/pb_tnc_msg.h"
28
29 #include <pen/pen.h>
30
31 /**
32 * PB-TNC PDP Identifier Types as defined in section 3.1.1.2 of the
33 * TCG TNC PDP Discovery and Validation Specification 1.0
34 */
35 enum pb_pdp_identifier_type_t {
36 PB_PDP_ID_FQDN = 0,
37 PB_PDP_ID_IPV4 = 1,
38 PB_PDP_ID_IPV6 = 2
39 };
40
41 /**
42 * enum name for pb_pdp_identifier_type_t.
43 */
44 extern enum_name_t *pb_pdp_identifier_type_names;
45
46 /**
47 * Class representing the PB-Remediation-Parameters message type.
48 */
49 struct pb_pdp_referral_msg_t {
50
51 /**
52 * PB-TNC Message interface
53 */
54 pb_tnc_msg_t pb_interface;
55
56 /**
57 * Get the PDP Identifier Type (Vendor ID and Type)
58 *
59 * @return PDP Identifier Type
60 */
61 pen_type_t (*get_identifier_type)(pb_pdp_referral_msg_t *this);
62
63 /**
64 * Get the PDP Identifier Value
65 *
66 * @return PDP Identifier Value
67 */
68 chunk_t (*get_identifier)(pb_pdp_referral_msg_t *this);
69
70 };
71
72 /**
73 * Create a general PB-PDP-Referral message
74 *
75 * @param identifier_type PDP Identifier Type
76 * @param identifier PDP Identifier
77 */
78 pb_tnc_msg_t* pb_pdp_referral_msg_create(pen_type_t identifier_type,
79 chunk_t identifier);
80
81 /**
82 * Create an unprocessed PB-PDP-Referral message from raw data
83 *
84 * @param data PB-PDP-Referral message data
85 */
86 pb_tnc_msg_t* pb_pdp_referral_msg_create_from_data(chunk_t data);
87
88 #endif /** PB_PA_MSG_H_ @}*/