aboutsummaryrefslogtreecommitdiffstats
path: root/src/libtnccs/plugins/tnccs_20/messages/tcg/pb_pdp_referral_msg.h
blob: a472557ca67284e7aa62eadb5a7a7fe8af0ddef0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
 * Copyright (C) 2013 Andreas Steffen
 * HSR Hochschule fuer Technik Rapperswil
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your
 * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 */

/**
 * @defgroup pb_pdp_referral_msg pb_pdp_referral_msg
 * @{ @ingroup tnccs_20
 */

#ifndef PB_PDP_REFERRAL_MSG_H_
#define PB_PDP_REFERRAL_MSG_H_

typedef enum pb_pdp_identifier_type_t pb_pdp_identifier_type_t;
typedef struct pb_pdp_referral_msg_t pb_pdp_referral_msg_t;

#include "messages/pb_tnc_msg.h"

#include <pen/pen.h>

/**
 * PB-TNC PDP Identifier Types as defined in section 3.1.1.2 of the
 * TCG TNC PDP Discovery and Validation Specification 1.0
 */
enum pb_pdp_identifier_type_t {
	PB_PDP_ID_FQDN =	0,
	PB_PDP_ID_IPV4 =	1,
	PB_PDP_ID_IPV6 =	2
};

/**
 * enum name for pb_pdp_identifier_type_t.
 */
extern enum_name_t *pb_pdp_identifier_type_names;

/**
 * Class representing the PB-Remediation-Parameters message type.
 */
struct pb_pdp_referral_msg_t {

	/**
	 * PB-TNC Message interface
	 */
	pb_tnc_msg_t pb_interface;

	/**
	 * Get the PDP Identifier Type (Vendor ID and Type)
	 *
	 * @return				PDP Identifier Type
	 */
	pen_type_t (*get_identifier_type)(pb_pdp_referral_msg_t *this);

	/**
	 * Get the PDP Identifier Value
	 *
	 * @return				PDP Identifier Value
	 */
	chunk_t (*get_identifier)(pb_pdp_referral_msg_t *this);

};

/**
 * Create a general PB-PDP-Referral message
 *
 * @param identifier_type	PDP Identifier Type
 * @param identifier		PDP Identifier
 */
pb_tnc_msg_t* pb_pdp_referral_msg_create(pen_type_t identifier_type,
										 chunk_t identifier);

/**
 * Create an unprocessed PB-PDP-Referral message from raw data
 *
  * @param data		PB-PDP-Referral message data
 */
pb_tnc_msg_t* pb_pdp_referral_msg_create_from_data(chunk_t data);

#endif /** PB_PA_MSG_H_ @}*/