Added add_segment() method to IETF attributes
[strongswan.git] / src / libimcv / imv / imv_reason_string.c
index 18eade0..c09b7bd 100644 (file)
@@ -35,6 +35,11 @@ struct private_imv_reason_string_t {
        char *lang;
 
        /**
+        * Separator concatenating multiple reasons
+        */
+       char *separator;
+
+       /**
         * Contains the concatenated reasons
         */
        chunk_t reasons;
@@ -51,7 +56,8 @@ METHOD(imv_reason_string_t, add_reason, void,
        if (this->reasons.len)
        {
                /* append any further reasons */
-               this->reasons = chunk_cat("cm", this->reasons, chunk_from_chars('\n'),
+               this->reasons = chunk_cat("mcc", this->reasons,
+                                                                 chunk_from_str(this->separator),
                                                                  chunk_create(s_reason, strlen(s_reason)));
        }
        else
@@ -77,7 +83,7 @@ METHOD(imv_reason_string_t, destroy, void,
 /**
  * Described in header.
  */
-imv_reason_string_t *imv_reason_string_create(char *lang)
+imv_reason_string_t *imv_reason_string_create(char *lang, char *separator)
 {
        private_imv_reason_string_t *this;
 
@@ -88,6 +94,7 @@ imv_reason_string_t *imv_reason_string_create(char *lang)
                        .destroy = _destroy,
                },
                .lang = lang,
+               .separator = separator,
        );
 
        return &this->public;