Added add_segment() method to ITA attributes
authorAndreas Steffen <andreas.steffen@strongswan.org>
Fri, 3 Oct 2014 19:03:23 +0000 (21:03 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Sun, 5 Oct 2014 16:43:54 +0000 (18:43 +0200)
src/libimcv/ita/ita_attr_angel.c
src/libimcv/ita/ita_attr_command.c
src/libimcv/ita/ita_attr_device_id.c
src/libimcv/ita/ita_attr_dummy.c
src/libimcv/ita/ita_attr_get_settings.c
src/libimcv/ita/ita_attr_settings.c

index ccedc1b..1108636 100644 (file)
@@ -86,6 +86,12 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_ita_attr_angel_t *this, chunk_t segment)
+{
+       /* nothing to add */
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_ita_attr_angel_t *this)
 {
@@ -118,6 +124,7 @@ pa_tnc_attr_t *ita_attr_angel_create(bool start)
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -145,6 +152,7 @@ pa_tnc_attr_t *ita_attr_angel_create_from_data(bool start)
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index 679f2c3..a6b187f 100644 (file)
@@ -114,6 +114,12 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_ita_attr_command_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_ita_attr_command_t *this)
 {
@@ -154,6 +160,7 @@ pa_tnc_attr_t *ita_attr_command_create(char *command)
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -183,6 +190,7 @@ pa_tnc_attr_t *ita_attr_command_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 885feeb..2328426 100644 (file)
@@ -100,6 +100,12 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_ita_attr_device_id_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_ita_attr_device_id_t *this)
 {
@@ -133,6 +139,7 @@ pa_tnc_attr_t *ita_attr_device_id_create_from_data(size_t length, chunk_t value)
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index 890dfcb..0d21ac6 100644 (file)
@@ -110,6 +110,12 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_ita_attr_dummy_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_ita_attr_dummy_t *this)
 {
@@ -149,6 +155,7 @@ pa_tnc_attr_t *ita_attr_dummy_create(size_t size)
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -178,6 +185,7 @@ pa_tnc_attr_t *ita_attr_dummy_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 b9a4ab2..3c047fb 100644 (file)
@@ -182,6 +182,12 @@ end:
        return status;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_ita_attr_get_settings_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_ita_attr_get_settings_t *this)
 {
@@ -228,6 +234,7 @@ pa_tnc_attr_t *ita_attr_get_settings_create(char *name)
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -263,6 +270,7 @@ pa_tnc_attr_t *ita_attr_get_settings_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 8f72056..ced3477 100644 (file)
@@ -227,6 +227,12 @@ end:
        return status;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_ita_attr_settings_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_ita_attr_settings_t *this)
 {
@@ -290,6 +296,7 @@ pa_tnc_attr_t *ita_attr_settings_create(void)
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -320,6 +327,7 @@ pa_tnc_attr_t *ita_attr_settings_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,
                        },