Merged libpts into libimcv
[strongswan.git] / src / libimcv / swid / swid_error.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 swid_error swid_error
18 * @{ @ingroup swid
19 */
20
21 #ifndef SWID_ERROR_H_
22 #define SWID_ERROR_H_
23
24 typedef enum swid_error_code_t swid_error_code_t;
25
26 #include "pa_tnc/pa_tnc_attr.h"
27
28 #include <library.h>
29
30
31 /**
32 * SWID Error Codes
33 * see section 3.14.2 of PTS Protocol: Binding to TNC IF-M Specification
34 */
35 enum swid_error_code_t {
36 TCG_SWID_ERROR = 0x20,
37 TCG_SWID_SUBSCRIPTION_DENIED = 0x21,
38 TCG_SWID_RESPONSE_TOO_LARGE = 0x22
39 };
40
41 /**
42 * enum name for swid_error_code_t.
43 */
44 extern enum_name_t *swid_error_code_names;
45
46 /**
47 * Creates a SWID Error Attribute
48 * see section 4.12 of TNC SWID Message and Attributes for IF-M
49 *
50 * @param code SWID error code
51 * @param request SWID request ID
52 * @param max_attr_size Maximum IF-M attribute size (if applicable)
53 * @param description Optional description string or NULL
54 */
55 pa_tnc_attr_t* swid_error_create(swid_error_code_t code, u_int32_t request,
56 u_int32_t max_attr_size, char *description);
57
58 #endif /** SWID_ERROR_H_ @}*/