]> git.ipfire.org Git - thirdparty/strongswan.git/blob - src/libimcv/ietf/ietf_attr_numeric_version.h
Update copyright headers after acquisition by secunet
[thirdparty/strongswan.git] / src / libimcv / ietf / ietf_attr_numeric_version.h
1 /*
2 * Copyright (C) 2012-2014 Andreas Steffen
3 *
4 * Copyright (C) secunet Security Networks AG
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 */
16
17 /**
18 * @defgroup ietf_attr_numeric_version ietf_attr_numeric_version
19 * @{ @ingroup ietf_attr
20 */
21
22 #ifndef IETF_ATTR_NUMERIC_VERSION_H_
23 #define IETF_ATTR_NUMERIC_VERSION_H_
24
25 typedef struct ietf_attr_numeric_version_t ietf_attr_numeric_version_t;
26
27 #include "ietf_attr.h"
28 #include "pa_tnc/pa_tnc_attr.h"
29
30
31 /**
32 * Class implementing the IETF PA-TNC String Version attribute.
33 *
34 */
35 struct ietf_attr_numeric_version_t {
36
37 /**
38 * Public PA-TNC attribute interface
39 */
40 pa_tnc_attr_t pa_tnc_attribute;
41
42 /**
43 * Gets the Major and Minor Version Numbers
44 *
45 * @param major Major Version Number
46 * @param minor Minor Version Number
47 */
48 void (*get_version)(ietf_attr_numeric_version_t *this,
49 uint32_t *major, uint32_t *minor);
50
51 /**
52 * Gets the Build Number
53 *
54 * @param major Major Version Number
55 * @param minor Minor Version Number
56 */
57 uint32_t (*get_build)(ietf_attr_numeric_version_t *this);
58
59 /**
60 * Gets the Major and Minor Numbers of the Service Pack
61 *
62 * @param major Service Pack Major Number
63 * @param minor Service Pack Minor Number
64 */
65 void (*get_service_pack)(ietf_attr_numeric_version_t *this,
66 uint16_t *major, uint16_t *minor);
67 };
68
69 /**
70 * Creates an ietf_attr_numeric_version_t object
71 *
72 */
73 pa_tnc_attr_t* ietf_attr_numeric_version_create(uint32_t major, uint32_t minor,
74 uint32_t build,
75 uint16_t service_pack_major,
76 uint16_t service_pack_minor);
77
78 /**
79 * Creates an ietf_attr_numeric_version_t object from received data
80 *
81 * @param length Total length of attribute value
82 * @param value Unparsed attribute value (might be a segment)
83 */
84 pa_tnc_attr_t* ietf_attr_numeric_version_create_from_data(size_t length,
85 chunk_t value);
86
87 #endif /** IETF_ATTR_NUMERIC_VERSION_H_ @}*/