aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2015-05-17 17:04:46 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2015-08-18 21:25:38 +0200
commit6a11c8a3f3c4a17432438a04542547947b06bc68 (patch)
tree1362f016da33ef742880dbc4abee06b32823f080 /src
parentabb8a1ecd22a95d56757c0e90ba064c3877c8dcd (diff)
downloadstrongswan-6a11c8a3f3c4a17432438a04542547947b06bc68.tar.bz2
strongswan-6a11c8a3f3c4a17432438a04542547947b06bc68.tar.xz
Support of HCD Firewall Setting PA-TNC attribute
Diffstat (limited to 'src')
-rw-r--r--src/libimcv/ietf/ietf_attr.c3
-rw-r--r--src/libimcv/ietf/ietf_attr_port_filter.c10
-rw-r--r--src/libimcv/ietf/ietf_attr_port_filter.h8
-rw-r--r--src/libimcv/plugins/imc_scanner/imc_scanner.c3
-rw-r--r--src/libimcv/pwg/pwg_attr.c8
5 files changed, 20 insertions, 12 deletions
diff --git a/src/libimcv/ietf/ietf_attr.c b/src/libimcv/ietf/ietf_attr.c
index d0f04393b..575cc72e5 100644
--- a/src/libimcv/ietf/ietf_attr.c
+++ b/src/libimcv/ietf/ietf_attr.c
@@ -62,7 +62,8 @@ pa_tnc_attr_t* ietf_attr_create_from_data(u_int32_t type, size_t length,
case IETF_ATTR_OPERATIONAL_STATUS:
return ietf_attr_op_status_create_from_data(length, value);
case IETF_ATTR_PORT_FILTER:
- return ietf_attr_port_filter_create_from_data(length, value);
+ return ietf_attr_port_filter_create_from_data(length, value,
+ pen_type_create(PEN_IETF, type));
case IETF_ATTR_INSTALLED_PACKAGES:
return ietf_attr_installed_packages_create_from_data(length, value);
case IETF_ATTR_PA_TNC_ERROR:
diff --git a/src/libimcv/ietf/ietf_attr_port_filter.c b/src/libimcv/ietf/ietf_attr_port_filter.c
index 46824406a..6f7ff54cc 100644
--- a/src/libimcv/ietf/ietf_attr_port_filter.c
+++ b/src/libimcv/ietf/ietf_attr_port_filter.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2014 Andreas Steffen
+ * Copyright (C) 2011-2015 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -236,7 +236,7 @@ METHOD(ietf_attr_port_filter_t, create_port_enumerator, enumerator_t*,
/**
* Described in header.
*/
-pa_tnc_attr_t *ietf_attr_port_filter_create(void)
+pa_tnc_attr_t *ietf_attr_port_filter_create(pen_type_t type)
{
private_ietf_attr_port_filter_t *this;
@@ -256,7 +256,7 @@ pa_tnc_attr_t *ietf_attr_port_filter_create(void)
.add_port = _add_port,
.create_port_enumerator = _create_port_enumerator,
},
- .type = { PEN_IETF, IETF_ATTR_PORT_FILTER },
+ .type = type,
.ports = linked_list_create(),
.ref = 1,
);
@@ -268,7 +268,7 @@ pa_tnc_attr_t *ietf_attr_port_filter_create(void)
* Described in header.
*/
pa_tnc_attr_t *ietf_attr_port_filter_create_from_data(size_t length,
- chunk_t data)
+ chunk_t data, pen_type_t type)
{
private_ietf_attr_port_filter_t *this;
@@ -288,7 +288,7 @@ pa_tnc_attr_t *ietf_attr_port_filter_create_from_data(size_t length,
.add_port = _add_port,
.create_port_enumerator = _create_port_enumerator,
},
- .type = {PEN_IETF, IETF_ATTR_PORT_FILTER },
+ .type = type,
.length = length,
.value = chunk_clone(data),
.ports = linked_list_create(),
diff --git a/src/libimcv/ietf/ietf_attr_port_filter.h b/src/libimcv/ietf/ietf_attr_port_filter.h
index d383b19a2..e6c5a3f61 100644
--- a/src/libimcv/ietf/ietf_attr_port_filter.h
+++ b/src/libimcv/ietf/ietf_attr_port_filter.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2014 Andreas Steffen
+ * Copyright (C) 2011-2015 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -61,16 +61,18 @@ struct ietf_attr_port_filter_t {
/**
* Creates an ietf_attr_port_filter_t object
*
+ * @param type Vendor ID / Attribute Type
*/
-pa_tnc_attr_t* ietf_attr_port_filter_create(void);
+pa_tnc_attr_t* ietf_attr_port_filter_create(pen_type_t type);
/**
* Creates an ietf_attr_port_filter_t object from received data
*
* @param length Total length of attribute value
* @param value Unparsed attribute value (might be a segment)
+ * @param type Vendor ID / Attribute Type
*/
pa_tnc_attr_t* ietf_attr_port_filter_create_from_data(size_t length,
- chunk_t value);
+ chunk_t value, pen_type_t type);
#endif /** IETF_ATTR_PORT_FILTER_H_ @}*/
diff --git a/src/libimcv/plugins/imc_scanner/imc_scanner.c b/src/libimcv/plugins/imc_scanner/imc_scanner.c
index 0478841cb..10e8faf91 100644
--- a/src/libimcv/plugins/imc_scanner/imc_scanner.c
+++ b/src/libimcv/plugins/imc_scanner/imc_scanner.c
@@ -241,7 +241,8 @@ static TNC_Result add_port_filter(imc_msg_t *msg)
pa_tnc_attr_t *attr;
ietf_attr_port_filter_t *attr_port_filter;
- attr = ietf_attr_port_filter_create();
+ attr = ietf_attr_port_filter_create(pen_type_create(PEN_IETF,
+ IETF_ATTR_PORT_FILTER));
attr->set_noskip_flag(attr, TRUE);
attr_port_filter = (ietf_attr_port_filter_t*)attr;
if (!do_netstat(attr_port_filter))
diff --git a/src/libimcv/pwg/pwg_attr.c b/src/libimcv/pwg/pwg_attr.c
index 9056a285f..bbc8e02c5 100644
--- a/src/libimcv/pwg/pwg_attr.c
+++ b/src/libimcv/pwg/pwg_attr.c
@@ -15,7 +15,9 @@
#include "pwg_attr.h"
-#include <generic/generic_attr_bool.h>
+#include "generic/generic_attr_bool.h"
+#include "ietf/ietf_attr_port_filter.h"
+
ENUM_BEGIN(pwg_attr_names, PWG_HCD_ATTRS_NATURAL_LANG,
PWG_HCD_VENDOR_SMI_CODE,
@@ -81,11 +83,13 @@ pa_tnc_attr_t* pwg_attr_create_from_data(u_int32_t type, size_t length, chunk_t
case PWG_HCD_PSTN_FAX_ENABLED:
return generic_attr_bool_create_from_data(length, value,
pen_type_create(PEN_PWG, type));
+ case PWG_HCD_FIREWALL_SETTING:
+ return ietf_attr_port_filter_create_from_data(length, value,
+ pen_type_create(PEN_PWG, type));
case PWG_HCD_ATTRS_NATURAL_LANG:
case PWG_HCD_MACHINE_TYPE_MODEL:
case PWG_HCD_VENDOR_NAME:
case PWG_HCD_VENDOR_SMI_CODE:
- case PWG_HCD_FIREWALL_SETTING:
case PWG_HCD_TIME_SOURCE:
case PWG_HCD_FIRMWARE_NAME:
case PWG_HCD_FIRMWARE_PATCHES: