summaryrefslogtreecommitdiff
path: root/src/libtnccs/plugins/tnccs_20/messages/ietf/pb_access_recommendation_msg.h
blob: 84b8d1a94e1439dc45b63b0ce40b55669119661a (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
/*
 * Copyright (C) 2010 Sansar Choinyambuu
 * 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_access_recommendation_msg pb_access_recommendation_msg
 * @{ @ingroup tnccs_20
 */

#ifndef PB_ACCESS_RECOMMENDATION_MSG_H_
#define PB_ACCESS_RECOMMENDATION_MSG_H_

typedef enum pb_access_recommendation_code_t pb_access_recommendation_code_t;
typedef struct pb_access_recommendation_msg_t pb_access_recommendation_msg_t;

#include "messages/pb_tnc_msg.h"

/**
 * PB Access Recommendation Codes as defined in section 4.7 of RFC 5793
 */
enum pb_access_recommendation_code_t {
	PB_REC_ACCESS_ALLOWED =	1,
	PB_REC_ACCESS_DENIED =	2,
	PB_REC_QUARANTINED =	3,
};

/**
 * enum name for pb_access_recommendation_code_t.
 */
extern enum_name_t *pb_access_recommendation_code_names;


/**
 * Class representing the PB-Access-Recommendation message type.
 */
struct pb_access_recommendation_msg_t {

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

	/**
	 * Get PB Access Recommendation
	 *
	 * @return			PB Access Recommendation
	 */
	uint16_t (*get_access_recommendation)(pb_access_recommendation_msg_t *this);
};

/**
 * Create a PB-Access-Recommendation message from parameters
 *
 * @param recommendation	Access Recommendation code
 */
pb_tnc_msg_t* pb_access_recommendation_msg_create(uint16_t recommendation);

/**
 * Create an unprocessed PB-Access-Recommendation message from raw data
 *
  * @param data		PB-Access-Recommendation message data
 */
pb_tnc_msg_t* pb_access_recommendation_msg_create_from_data(chunk_t data);

#endif /** PB_PA_MSG_H_ @}*/