2 * Copyright (C) 2012-2014 Andreas Steffen
4 * Copyright (C) secunet Security Networks AG
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>.
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
18 * @defgroup ietf_attr_numeric_version ietf_attr_numeric_version
19 * @{ @ingroup ietf_attr
22 #ifndef IETF_ATTR_NUMERIC_VERSION_H_
23 #define IETF_ATTR_NUMERIC_VERSION_H_
25 typedef struct ietf_attr_numeric_version_t ietf_attr_numeric_version_t
;
27 #include "ietf_attr.h"
28 #include "pa_tnc/pa_tnc_attr.h"
32 * Class implementing the IETF PA-TNC String Version attribute.
35 struct ietf_attr_numeric_version_t
{
38 * Public PA-TNC attribute interface
40 pa_tnc_attr_t pa_tnc_attribute
;
43 * Gets the Major and Minor Version Numbers
45 * @param major Major Version Number
46 * @param minor Minor Version Number
48 void (*get_version
)(ietf_attr_numeric_version_t
*this,
49 uint32_t *major
, uint32_t *minor
);
52 * Gets the Build Number
54 * @param major Major Version Number
55 * @param minor Minor Version Number
57 uint32_t (*get_build
)(ietf_attr_numeric_version_t
*this);
60 * Gets the Major and Minor Numbers of the Service Pack
62 * @param major Service Pack Major Number
63 * @param minor Service Pack Minor Number
65 void (*get_service_pack
)(ietf_attr_numeric_version_t
*this,
66 uint16_t *major
, uint16_t *minor
);
70 * Creates an ietf_attr_numeric_version_t object
73 pa_tnc_attr_t
* ietf_attr_numeric_version_create(uint32_t major
, uint32_t minor
,
75 uint16_t service_pack_major
,
76 uint16_t service_pack_minor
);
79 * Creates an ietf_attr_numeric_version_t object from received data
81 * @param length Total length of attribute value
82 * @param value Unparsed attribute value (might be a segment)
84 pa_tnc_attr_t
* ietf_attr_numeric_version_create_from_data(size_t length
,
87 #endif /** IETF_ATTR_NUMERIC_VERSION_H_ @}*/