summaryrefslogtreecommitdiff
path: root/src/libtnccs/plugins/tnccs_20/messages/ita/pb_mutual_capability_msg.h
blob: db810a01223fc5f1187b48a020e6fa3190c8d287 (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
/*
 * Copyright (C) 2015 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_mutual_capability_msg pb_mutual_capability_msg
 * @{ @ingroup tnccs_20
 */

#ifndef PB_MUTUAL_CAPABILITY_MSG_H_
#define PB_MUTUAL_CAPABILITY_MSG_H_

typedef enum pb_tnc_mutual_protocol_type_t pb_tnc_mutual_protocol_type_t;
typedef struct pb_mutual_capability_msg_t pb_mutual_capability_msg_t;

#include "messages/pb_tnc_msg.h"

/**
 * PB-TNC mutual protocol types
 */
enum pb_tnc_mutual_protocol_type_t {
	PB_MUTUAL_HALF_DUPLEX =	(1 << 31),
	PB_MUTUAL_FULL_DUPLEX =	(1 << 30)
};

/**
 * enum name for pb_mutual_protocol_type_t.
 */
extern enum_name_t *pb_tnc_mutual_protocol_type_names;

/**
 * Class representing the PB-Mutual-Capabilities message type.
 */
struct pb_mutual_capability_msg_t {

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

	/**
	 * Get the PB-TNC mutual protocol types
	 *
	 * @return				PB-TNC mutual protocol types
	 */
	uint32_t(*get_protocols)(pb_mutual_capability_msg_t *this);

};

/**
 * Create a PB-Mutual-Capability message
 *
 * @param protocols			Supported PB-TNC mutual protocols
 */
pb_tnc_msg_t* pb_mutual_capability_msg_create(uint32_t protocols);

/**
 * Create an unprocessed PB-Mutual-Capability message from raw data
 *
  * @param data		PB-Mutual-Capability message data
 */
pb_tnc_msg_t* pb_mutual_capability_msg_create_from_data(chunk_t data);

#endif /** PB_MUTUAL_CAPABILITY_MSG_ @}*/