Added add_segment() method to IETF attributes
authorAndreas Steffen <andreas.steffen@strongswan.org>
Fri, 3 Oct 2014 20:17:47 +0000 (22:17 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Sun, 5 Oct 2014 16:43:54 +0000 (18:43 +0200)
12 files changed:
src/libimcv/ietf/ietf_attr_assess_result.c
src/libimcv/ietf/ietf_attr_attr_request.c
src/libimcv/ietf/ietf_attr_default_pwd_enabled.c
src/libimcv/ietf/ietf_attr_fwd_enabled.c
src/libimcv/ietf/ietf_attr_installed_packages.c
src/libimcv/ietf/ietf_attr_numeric_version.c
src/libimcv/ietf/ietf_attr_op_status.c
src/libimcv/ietf/ietf_attr_pa_tnc_error.c
src/libimcv/ietf/ietf_attr_port_filter.c
src/libimcv/ietf/ietf_attr_product_info.c
src/libimcv/ietf/ietf_attr_remediation_instr.c
src/libimcv/ietf/ietf_attr_string_version.c

index f3b24f3..1cffdca 100644 (file)
@@ -139,6 +139,12 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_ietf_attr_assess_result_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_ietf_attr_assess_result_t *this)
 {
@@ -178,6 +184,7 @@ pa_tnc_attr_t *ietf_attr_assess_result_create(u_int32_t result)
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -208,6 +215,7 @@ pa_tnc_attr_t *ietf_attr_assess_result_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index e1047aa..3862a0a 100644 (file)
@@ -196,6 +196,12 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_ietf_attr_attr_request_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_ietf_attr_attr_request_t *this)
 {
@@ -236,6 +242,7 @@ pa_tnc_attr_t *ietf_attr_attr_request_create(pen_t vendor_id, u_int32_t type)
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -272,6 +279,7 @@ pa_tnc_attr_t *ietf_attr_attr_request_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index 11a502a..ee5864d 100644 (file)
@@ -149,6 +149,12 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_ietf_attr_default_pwd_enabled_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_ietf_attr_default_pwd_enabled_t *this)
 {
@@ -188,6 +194,7 @@ pa_tnc_attr_t *ietf_attr_default_pwd_enabled_create(bool status)
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -218,6 +225,7 @@ pa_tnc_attr_t *ietf_attr_default_pwd_enabled_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index 18c19ae..c00a5ef 100644 (file)
@@ -148,6 +148,12 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_ietf_attr_fwd_enabled_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_ietf_attr_fwd_enabled_t *this)
 {
@@ -187,6 +193,7 @@ pa_tnc_attr_t *ietf_attr_fwd_enabled_create(os_fwd_status_t fwd_status)
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -217,6 +224,7 @@ pa_tnc_attr_t *ietf_attr_fwd_enabled_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index 2f37e4f..2c61d72 100644 (file)
@@ -227,6 +227,12 @@ end:
        return status;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_ietf_attr_installed_packages_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_ietf_attr_installed_packages_t *this)
 {
@@ -295,6 +301,7 @@ pa_tnc_attr_t *ietf_attr_installed_packages_create(void)
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -327,6 +334,7 @@ pa_tnc_attr_t *ietf_attr_installed_packages_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index 3e87887..c8fd6c1 100644 (file)
@@ -174,6 +174,12 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_ietf_attr_numeric_version_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_ietf_attr_numeric_version_t *this)
 {
@@ -242,6 +248,7 @@ pa_tnc_attr_t *ietf_attr_numeric_version_create(u_int32_t major, u_int32_t minor
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -278,6 +285,7 @@ pa_tnc_attr_t *ietf_attr_numeric_version_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index e788ff6..d061a52 100644 (file)
@@ -222,6 +222,12 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_ietf_attr_op_status_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_ietf_attr_op_status_t *this)
 {
@@ -274,6 +280,7 @@ pa_tnc_attr_t *ietf_attr_op_status_create(u_int8_t status, u_int8_t result,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -307,6 +314,7 @@ pa_tnc_attr_t *ietf_attr_op_status_create_from_data(size_t length, chunk_t data)
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index 9c7ef48..0dbb4aa 100644 (file)
@@ -296,6 +296,12 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_ietf_attr_pa_tnc_error_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_ietf_attr_pa_tnc_error_t *this)
 {
@@ -365,6 +371,7 @@ static private_ietf_attr_pa_tnc_error_t* create_generic()
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index 2b026d7..4682440 100644 (file)
@@ -176,6 +176,12 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_ietf_attr_port_filter_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_ietf_attr_port_filter_t *this)
 {
@@ -243,6 +249,7 @@ pa_tnc_attr_t *ietf_attr_port_filter_create(void)
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -274,6 +281,7 @@ pa_tnc_attr_t *ietf_attr_port_filter_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index f1ff1c8..37c89e9 100644 (file)
@@ -165,6 +165,12 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_ietf_attr_product_info_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_ietf_attr_product_info_t *this)
 {
@@ -214,6 +220,7 @@ pa_tnc_attr_t *ietf_attr_product_info_create(pen_t vendor_id, u_int16_t id,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -246,6 +253,7 @@ pa_tnc_attr_t *ietf_attr_product_info_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index 0f5fba7..6407037 100644 (file)
@@ -228,6 +228,12 @@ end:
        return status;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_ietf_attr_remediation_instr_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_ietf_attr_remediation_instr_t *this)
 {
@@ -285,6 +291,7 @@ pa_tnc_attr_t *ietf_attr_remediation_instr_create(pen_type_t parameters_type,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -352,6 +359,7 @@ pa_tnc_attr_t *ietf_attr_remediation_instr_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index 5bd17c3..c46200b 100644 (file)
@@ -208,6 +208,12 @@ end:
        return status;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_ietf_attr_string_version_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_ietf_attr_string_version_t *this)
 {
@@ -264,6 +270,7 @@ pa_tnc_attr_t *ietf_attr_string_version_create(chunk_t version, chunk_t build,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -296,6 +303,7 @@ pa_tnc_attr_t *ietf_attr_string_version_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },