BMPString and UniversalString support


git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@1271 59561ff5-6e30-0410-9f3c-9617f08c8826
diff --git a/tests/119-per-strings-OK.asn1 b/tests/119-per-strings-OK.asn1
index 856b51b..ae1ec46 100644
--- a/tests/119-per-strings-OK.asn1
+++ b/tests/119-per-strings-OK.asn1
@@ -31,6 +31,16 @@
 		ut-c	UTF8String (SIZE(6))		OPTIONAL,
 		ut-ce	UTF8String (SIZE(6,...))	OPTIONAL,
 		ut-ir	UTF8String (FROM("A"|"Z"))	OPTIONAL,
+		bm	BMPString			OPTIONAL,
+		bm-c	BMPString (FROM("A".."Z"))	OPTIONAL,
+		bm-cs	BMPString (SIZE(6))	OPTIONAL,
+		bm-ce	BMPString (FROM("A".."Z",...))	OPTIONAL,
+		bm-ir	BMPString (FROM("A".."B"|"X".."Z"))	OPTIONAL,
+		us	UniversalString			OPTIONAL,
+		us-c	UniversalString (FROM("A".."Z"))	OPTIONAL,
+		us-cs	UniversalString (SIZE(6))	OPTIONAL,
+		us-ce	UniversalString (FROM("A".."Z",...))	OPTIONAL,
+		us-ir	UniversalString (FROM("A".."B"|"X".."Z")) OPTIONAL,
 		real	REAL				OPTIONAL,
 		oid	OBJECT IDENTIFIER		OPTIONAL
 	}
diff --git a/tests/119-per-strings-OK.asn1.-EF b/tests/119-per-strings-OK.asn1.-EF
index 7ec858d..7819c03 100644
--- a/tests/119-per-strings-OK.asn1.-EF
+++ b/tests/119-per-strings-OK.asn1.-EF
@@ -23,8 +23,18 @@
     ut-c	 [16] IMPLICIT UTF8String (SIZE(6)) OPTIONAL,
     ut-ce	 [17] IMPLICIT UTF8String (SIZE(6,...)) OPTIONAL,
     ut-ir	 [18] IMPLICIT UTF8String (FROM("A" | "Z")) OPTIONAL,
-    real	 [19] IMPLICIT REAL OPTIONAL,
-    oid	 [20] IMPLICIT OBJECT IDENTIFIER OPTIONAL
+    bm	 [19] IMPLICIT BMPString OPTIONAL,
+    bm-c	 [20] IMPLICIT BMPString (FROM("A".."Z")) OPTIONAL,
+    bm-cs	 [21] IMPLICIT BMPString (SIZE(6)) OPTIONAL,
+    bm-ce	 [22] IMPLICIT BMPString (FROM("A".."Z",...)) OPTIONAL,
+    bm-ir	 [23] IMPLICIT BMPString (FROM("A".."B" | "X".."Z")) OPTIONAL,
+    us	 [24] IMPLICIT UniversalString OPTIONAL,
+    us-c	 [25] IMPLICIT UniversalString (FROM("A".."Z")) OPTIONAL,
+    us-cs	 [26] IMPLICIT UniversalString (SIZE(6)) OPTIONAL,
+    us-ce	 [27] IMPLICIT UniversalString (FROM("A".."Z",...)) OPTIONAL,
+    us-ir	 [28] IMPLICIT UniversalString (FROM("A".."B" | "X".."Z")) OPTIONAL,
+    real	 [29] IMPLICIT REAL OPTIONAL,
+    oid	 [30] IMPLICIT OBJECT IDENTIFIER OPTIONAL
 }
 
 END
diff --git a/tests/119-per-strings-OK.asn1.-Pgen-PER b/tests/119-per-strings-OK.asn1.-Pgen-PER
index e94558e..3a24fda 100644
--- a/tests/119-per-strings-OK.asn1.-Pgen-PER
+++ b/tests/119-per-strings-OK.asn1.-Pgen-PER
@@ -6,6 +6,8 @@
 #include <PrintableString.h>
 #include <NumericString.h>
 #include <UTF8String.h>
+#include <BMPString.h>
+#include <UniversalString.h>
 #include <REAL.h>
 #include <OBJECT_IDENTIFIER.h>
 #include <asn_SEQUENCE_OF.h>
@@ -43,6 +45,16 @@
 	UTF8String_t	*ut_c	/* OPTIONAL */;
 	UTF8String_t	*ut_ce	/* OPTIONAL */;
 	UTF8String_t	*ut_ir	/* OPTIONAL */;
+	BMPString_t	*bm	/* OPTIONAL */;
+	BMPString_t	*bm_c	/* OPTIONAL */;
+	BMPString_t	*bm_cs	/* OPTIONAL */;
+	BMPString_t	*bm_ce	/* OPTIONAL */;
+	BMPString_t	*bm_ir	/* OPTIONAL */;
+	UniversalString_t	*us	/* OPTIONAL */;
+	UniversalString_t	*us_c	/* OPTIONAL */;
+	UniversalString_t	*us_cs	/* OPTIONAL */;
+	UniversalString_t	*us_ce	/* OPTIONAL */;
+	UniversalString_t	*us_ir	/* OPTIONAL */;
 	REAL_t	*real	/* OPTIONAL */;
 	OBJECT_IDENTIFIER_t	*oid	/* OPTIONAL */;
 	
@@ -277,6 +289,162 @@
 	return 0;
 }
 
+static int check_permitted_alphabet_23(const void *sptr) {
+	/* The underlying type is BMPString */
+	const BMPString_t *st = (const BMPString_t *)sptr;
+	const uint8_t *ch = st->buf;
+	const uint8_t *end = ch + st->size;
+	
+	if(st->size % 2) return -1; /* (size%2)! */
+	for(; ch < end; ch += 2) {
+		uint16_t cv = (ch[0] << 8)
+				| ch[1];
+		if(!(cv >= 65 && cv <= 90)) return -1;
+	}
+	return 0;
+}
+
+static int check_permitted_alphabet_24(const void *sptr) {
+	/* The underlying type is BMPString */
+	const BMPString_t *st = (const BMPString_t *)sptr;
+	const uint8_t *ch = st->buf;
+	const uint8_t *end = ch + st->size;
+	
+	if(st->size % 2) return -1; /* (size%2)! */
+	for(; ch < end; ch += 2) {
+		uint16_t cv = (ch[0] << 8)
+				| ch[1];
+		if(!(cv <= 65533)) return -1;
+	}
+	return 0;
+}
+
+static int check_permitted_alphabet_25(const void *sptr) {
+	/* The underlying type is BMPString */
+	const BMPString_t *st = (const BMPString_t *)sptr;
+	const uint8_t *ch = st->buf;
+	const uint8_t *end = ch + st->size;
+	
+	if(st->size % 2) return -1; /* (size%2)! */
+	for(; ch < end; ch += 2) {
+		uint16_t cv = (ch[0] << 8)
+				| ch[1];
+		if(!(cv >= 65 && cv <= 90)) return -1;
+	}
+	return 0;
+}
+
+static int permitted_alphabet_table_26[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*  AB              */
+ 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 5, 0, 0, 0, 0, 0,	/*         XYZ      */
+};
+static int permitted_alphabet_code2value_26[5] = {
+65,66,88,89,90,};
+
+
+static int check_permitted_alphabet_26(const void *sptr) {
+	int *table = permitted_alphabet_table_26;
+	/* The underlying type is BMPString */
+	const BMPString_t *st = (const BMPString_t *)sptr;
+	const uint8_t *ch = st->buf;
+	const uint8_t *end = ch + st->size;
+	
+	if(st->size % 2) return -1; /* (size%2)! */
+	for(; ch < end; ch += 2) {
+		uint16_t cv = (ch[0] << 8)
+				| ch[1];
+		if(cv > 255) return -1;
+		if(!table[cv]) return -1;
+	}
+	return 0;
+}
+
+static int check_permitted_alphabet_28(const void *sptr) {
+	/* The underlying type is UniversalString */
+	const UniversalString_t *st = (const UniversalString_t *)sptr;
+	const uint8_t *ch = st->buf;
+	const uint8_t *end = ch + st->size;
+	
+	if(st->size % 4) return -1; /* (size%4)! */
+	for(; ch < end; ch += 4) {
+		uint32_t cv = (ch[0] << 24)
+				| (ch[1] << 16)
+				| (ch[2] << 8)
+				|  ch[3];
+		if(!(cv >= 65 && cv <= 90)) return -1;
+	}
+	return 0;
+}
+
+static int check_permitted_alphabet_29(const void *sptr) {
+	/* The underlying type is UniversalString */
+	const UniversalString_t *st = (const UniversalString_t *)sptr;
+	const uint8_t *ch = st->buf;
+	const uint8_t *end = ch + st->size;
+	
+	if(st->size % 4) return -1; /* (size%4)! */
+	for(; ch < end; ch += 4) {
+		uint32_t cv = (ch[0] << 24)
+				| (ch[1] << 16)
+				| (ch[2] << 8)
+				|  ch[3];
+		if(!(1 /* Constraint matches natural range of cv */)) return -1;
+	}
+	return 0;
+}
+
+static int check_permitted_alphabet_30(const void *sptr) {
+	/* The underlying type is UniversalString */
+	const UniversalString_t *st = (const UniversalString_t *)sptr;
+	const uint8_t *ch = st->buf;
+	const uint8_t *end = ch + st->size;
+	
+	if(st->size % 4) return -1; /* (size%4)! */
+	for(; ch < end; ch += 4) {
+		uint32_t cv = (ch[0] << 24)
+				| (ch[1] << 16)
+				| (ch[2] << 8)
+				|  ch[3];
+		if(!(cv >= 65 && cv <= 90)) return -1;
+	}
+	return 0;
+}
+
+static int permitted_alphabet_table_31[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*  AB              */
+ 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 5, 0, 0, 0, 0, 0,	/*         XYZ      */
+};
+static int permitted_alphabet_code2value_31[5] = {
+65,66,88,89,90,};
+
+
+static int check_permitted_alphabet_31(const void *sptr) {
+	int *table = permitted_alphabet_table_31;
+	/* The underlying type is UniversalString */
+	const UniversalString_t *st = (const UniversalString_t *)sptr;
+	const uint8_t *ch = st->buf;
+	const uint8_t *end = ch + st->size;
+	
+	if(st->size % 4) return -1; /* (size%4)! */
+	for(; ch < end; ch += 4) {
+		uint32_t cv = (ch[0] << 24)
+				| (ch[1] << 16)
+				| (ch[2] << 8)
+				|  ch[3];
+		if(cv > 255) return -1;
+		if(!table[cv]) return -1;
+	}
+	return 0;
+}
+
 
 /*** <<< CODE [PDU] >>> ***/
 
@@ -672,6 +840,224 @@
 	}
 }
 
+static int
+memb_bm_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BMPString_t *st = (const BMPString_t *)sptr;
+	
+	if(!sptr) {
+		_ASN_CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(!check_permitted_alphabet_23(st)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		_ASN_CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_bm_cs_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BMPString_t *st = (const BMPString_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		_ASN_CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	size = st->size >> 1;	/* 2 byte per character */
+	
+	if((size == 6)
+		 && !check_permitted_alphabet_24(st)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		_ASN_CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_bm_ce_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BMPString_t *st = (const BMPString_t *)sptr;
+	
+	if(!sptr) {
+		_ASN_CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(!check_permitted_alphabet_25(st)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		_ASN_CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_bm_ir_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BMPString_t *st = (const BMPString_t *)sptr;
+	
+	if(!sptr) {
+		_ASN_CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(!check_permitted_alphabet_26(st)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		_ASN_CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int asn_PER_MAP_bm_ir_26_v2c(unsigned int value) {
+	if(value >= sizeof(permitted_alphabet_table_26)/sizeof(permitted_alphabet_table_26[0]))
+		return -1;
+	return permitted_alphabet_table_26[value] - 1;
+}
+static int asn_PER_MAP_bm_ir_26_c2v(unsigned int code) {
+	if(code >= sizeof(permitted_alphabet_code2value_26)/sizeof(permitted_alphabet_code2value_26[0]))
+		return -1;
+	return permitted_alphabet_code2value_26[code];
+}
+static int
+memb_us_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const UniversalString_t *st = (const UniversalString_t *)sptr;
+	
+	if(!sptr) {
+		_ASN_CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(!check_permitted_alphabet_28(st)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		_ASN_CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_us_cs_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const UniversalString_t *st = (const UniversalString_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		_ASN_CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	size = st->size >> 2;	/* 4 byte per character */
+	
+	if((size == 6)
+		 && !check_permitted_alphabet_29(st)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		_ASN_CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_us_ce_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const UniversalString_t *st = (const UniversalString_t *)sptr;
+	
+	if(!sptr) {
+		_ASN_CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(!check_permitted_alphabet_30(st)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		_ASN_CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_us_ir_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const UniversalString_t *st = (const UniversalString_t *)sptr;
+	
+	if(!sptr) {
+		_ASN_CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(!check_permitted_alphabet_31(st)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		_ASN_CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int asn_PER_MAP_us_ir_31_v2c(unsigned int value) {
+	if(value >= sizeof(permitted_alphabet_table_31)/sizeof(permitted_alphabet_table_31[0]))
+		return -1;
+	return permitted_alphabet_table_31[value] - 1;
+}
+static int asn_PER_MAP_us_ir_31_c2v(unsigned int code) {
+	if(code >= sizeof(permitted_alphabet_code2value_31)/sizeof(permitted_alphabet_code2value_31[0]))
+		return -1;
+	return permitted_alphabet_code2value_31[code];
+}
 
 /*** <<< CTDEFS [PDU] >>> ***/
 
@@ -749,6 +1135,49 @@
 	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
 	0, 0	/* No PER value map */
 };
+static asn_per_constraints_t asn_PER_memb_bm_c_constr_23 = {
+	{ APC_CONSTRAINED,	 5,  5,  65,  90 }	/* (65..90) */,
+	{ APC_SEMI_CONSTRAINED,	-1, -1,  0,  0 }	/* (SIZE(0..MAX)) */,
+	0, 0	/* No PER character map necessary */
+};
+static asn_per_constraints_t asn_PER_memb_bm_cs_constr_24 = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65533 }	/* (0..65533) */,
+	{ APC_CONSTRAINED,	 0,  0,  6,  6 }	/* (SIZE(6..6)) */,
+	0, 0	/* No PER character map necessary */
+};
+static asn_per_constraints_t asn_PER_memb_bm_ce_constr_25 = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_SEMI_CONSTRAINED,	-1, -1,  0,  0 }	/* (SIZE(0..MAX)) */,
+	0, 0	/* No PER character map necessary */
+};
+static asn_per_constraints_t asn_PER_memb_bm_ir_constr_26 = {
+	{ APC_CONSTRAINED,	 3,  3,  65,  90 }	/* (65..90) */,
+	{ APC_SEMI_CONSTRAINED,	-1, -1,  0,  0 }	/* (SIZE(0..MAX)) */,
+	asn_PER_MAP_bm_ir_26_v2c,	/* Value to PER code map */
+	asn_PER_MAP_bm_ir_26_c2v	/* PER code to value map */
+};
+static asn_per_constraints_t asn_PER_memb_us_c_constr_28 = {
+	{ APC_CONSTRAINED,	 5,  5,  65,  90 }	/* (65..90) */,
+	{ APC_SEMI_CONSTRAINED,	-1, -1,  0,  0 }	/* (SIZE(0..MAX)) */,
+	0, 0	/* No PER character map necessary */
+};
+static asn_per_constraints_t asn_PER_memb_us_cs_constr_29 = {
+	{ APC_CONSTRAINED,	 32,  32,  0,  2147483647 }	/* (0..4294967295) */,
+	{ APC_CONSTRAINED,	 0,  0,  6,  6 }	/* (SIZE(6..6)) */,
+	0, 0	/* No PER character map necessary */
+};
+static asn_per_constraints_t asn_PER_memb_us_ce_constr_30 = {
+	{ APC_CONSTRAINED,	32, 32, 0, 2147483647 } /* special case 1 */
+	,
+	{ APC_SEMI_CONSTRAINED,	-1, -1,  0,  0 }	/* (SIZE(0..MAX)) */,
+	0, 0	/* No PER character map necessary */
+};
+static asn_per_constraints_t asn_PER_memb_us_ir_constr_31 = {
+	{ APC_CONSTRAINED,	 3,  3,  65,  90 }	/* (65..90) */,
+	{ APC_SEMI_CONSTRAINED,	-1, -1,  0,  0 }	/* (SIZE(0..MAX)) */,
+	asn_PER_MAP_us_ir_31_v2c,	/* Value to PER code map */
+	asn_PER_MAP_us_ir_31_c2v	/* PER code to value map */
+};
 
 /*** <<< STAT-DEFS [PDU] >>> ***/
 
@@ -799,7 +1228,7 @@
 };
 
 static asn_TYPE_member_t asn_MBR_PDU_1[] = {
-	{ ATF_POINTER, 21, offsetof(struct PDU, many),
+	{ ATF_POINTER, 31, offsetof(struct PDU, many),
 		.tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
 		.tag_mode = 0,
 		.type = &asn_DEF_many_2,
@@ -808,7 +1237,7 @@
 		.default_value = 0,
 		.name = "many"
 		},
-	{ ATF_POINTER, 20, offsetof(struct PDU, ia5),
+	{ ATF_POINTER, 30, offsetof(struct PDU, ia5),
 		.tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
 		.tag_mode = -1,	/* IMPLICIT tag at current level */
 		.type = &asn_DEF_IA5String,
@@ -817,7 +1246,7 @@
 		.default_value = 0,
 		.name = "ia5"
 		},
-	{ ATF_POINTER, 19, offsetof(struct PDU, ia5_c),
+	{ ATF_POINTER, 29, offsetof(struct PDU, ia5_c),
 		.tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
 		.tag_mode = -1,	/* IMPLICIT tag at current level */
 		.type = &asn_DEF_IA5String,
@@ -826,7 +1255,7 @@
 		.default_value = 0,
 		.name = "ia5-c"
 		},
-	{ ATF_POINTER, 18, offsetof(struct PDU, ia5_ce),
+	{ ATF_POINTER, 28, offsetof(struct PDU, ia5_ce),
 		.tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
 		.tag_mode = -1,	/* IMPLICIT tag at current level */
 		.type = &asn_DEF_IA5String,
@@ -835,7 +1264,7 @@
 		.default_value = 0,
 		.name = "ia5-ce"
 		},
-	{ ATF_POINTER, 17, offsetof(struct PDU, ia5_ir),
+	{ ATF_POINTER, 27, offsetof(struct PDU, ia5_ir),
 		.tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
 		.tag_mode = -1,	/* IMPLICIT tag at current level */
 		.type = &asn_DEF_IA5String,
@@ -844,7 +1273,7 @@
 		.default_value = 0,
 		.name = "ia5-ir"
 		},
-	{ ATF_POINTER, 16, offsetof(struct PDU, vs),
+	{ ATF_POINTER, 26, offsetof(struct PDU, vs),
 		.tag = (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
 		.tag_mode = -1,	/* IMPLICIT tag at current level */
 		.type = &asn_DEF_VisibleString,
@@ -853,7 +1282,7 @@
 		.default_value = 0,
 		.name = "vs"
 		},
-	{ ATF_POINTER, 15, offsetof(struct PDU, vs_c),
+	{ ATF_POINTER, 25, offsetof(struct PDU, vs_c),
 		.tag = (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
 		.tag_mode = -1,	/* IMPLICIT tag at current level */
 		.type = &asn_DEF_VisibleString,
@@ -862,7 +1291,7 @@
 		.default_value = 0,
 		.name = "vs-c"
 		},
-	{ ATF_POINTER, 14, offsetof(struct PDU, vs_ce),
+	{ ATF_POINTER, 24, offsetof(struct PDU, vs_ce),
 		.tag = (ASN_TAG_CLASS_CONTEXT | (7 << 2)),
 		.tag_mode = -1,	/* IMPLICIT tag at current level */
 		.type = &asn_DEF_VisibleString,
@@ -871,7 +1300,7 @@
 		.default_value = 0,
 		.name = "vs-ce"
 		},
-	{ ATF_POINTER, 13, offsetof(struct PDU, vs_ir),
+	{ ATF_POINTER, 23, offsetof(struct PDU, vs_ir),
 		.tag = (ASN_TAG_CLASS_CONTEXT | (8 << 2)),
 		.tag_mode = -1,	/* IMPLICIT tag at current level */
 		.type = &asn_DEF_VisibleString,
@@ -880,7 +1309,7 @@
 		.default_value = 0,
 		.name = "vs-ir"
 		},
-	{ ATF_POINTER, 12, offsetof(struct PDU, pr),
+	{ ATF_POINTER, 22, offsetof(struct PDU, pr),
 		.tag = (ASN_TAG_CLASS_CONTEXT | (9 << 2)),
 		.tag_mode = -1,	/* IMPLICIT tag at current level */
 		.type = &asn_DEF_PrintableString,
@@ -889,7 +1318,7 @@
 		.default_value = 0,
 		.name = "pr"
 		},
-	{ ATF_POINTER, 11, offsetof(struct PDU, pr_c),
+	{ ATF_POINTER, 21, offsetof(struct PDU, pr_c),
 		.tag = (ASN_TAG_CLASS_CONTEXT | (10 << 2)),
 		.tag_mode = -1,	/* IMPLICIT tag at current level */
 		.type = &asn_DEF_PrintableString,
@@ -898,7 +1327,7 @@
 		.default_value = 0,
 		.name = "pr-c"
 		},
-	{ ATF_POINTER, 10, offsetof(struct PDU, pr_ir),
+	{ ATF_POINTER, 20, offsetof(struct PDU, pr_ir),
 		.tag = (ASN_TAG_CLASS_CONTEXT | (11 << 2)),
 		.tag_mode = -1,	/* IMPLICIT tag at current level */
 		.type = &asn_DEF_PrintableString,
@@ -907,7 +1336,7 @@
 		.default_value = 0,
 		.name = "pr-ir"
 		},
-	{ ATF_POINTER, 9, offsetof(struct PDU, ns),
+	{ ATF_POINTER, 19, offsetof(struct PDU, ns),
 		.tag = (ASN_TAG_CLASS_CONTEXT | (12 << 2)),
 		.tag_mode = -1,	/* IMPLICIT tag at current level */
 		.type = &asn_DEF_NumericString,
@@ -916,7 +1345,7 @@
 		.default_value = 0,
 		.name = "ns"
 		},
-	{ ATF_POINTER, 8, offsetof(struct PDU, ns_c),
+	{ ATF_POINTER, 18, offsetof(struct PDU, ns_c),
 		.tag = (ASN_TAG_CLASS_CONTEXT | (13 << 2)),
 		.tag_mode = -1,	/* IMPLICIT tag at current level */
 		.type = &asn_DEF_NumericString,
@@ -925,7 +1354,7 @@
 		.default_value = 0,
 		.name = "ns-c"
 		},
-	{ ATF_POINTER, 7, offsetof(struct PDU, ns_ce),
+	{ ATF_POINTER, 17, offsetof(struct PDU, ns_ce),
 		.tag = (ASN_TAG_CLASS_CONTEXT | (14 << 2)),
 		.tag_mode = -1,	/* IMPLICIT tag at current level */
 		.type = &asn_DEF_NumericString,
@@ -934,7 +1363,7 @@
 		.default_value = 0,
 		.name = "ns-ce"
 		},
-	{ ATF_POINTER, 6, offsetof(struct PDU, ns_ir),
+	{ ATF_POINTER, 16, offsetof(struct PDU, ns_ir),
 		.tag = (ASN_TAG_CLASS_CONTEXT | (15 << 2)),
 		.tag_mode = -1,	/* IMPLICIT tag at current level */
 		.type = &asn_DEF_NumericString,
@@ -943,7 +1372,7 @@
 		.default_value = 0,
 		.name = "ns-ir"
 		},
-	{ ATF_POINTER, 5, offsetof(struct PDU, ut_c),
+	{ ATF_POINTER, 15, offsetof(struct PDU, ut_c),
 		.tag = (ASN_TAG_CLASS_CONTEXT | (16 << 2)),
 		.tag_mode = -1,	/* IMPLICIT tag at current level */
 		.type = &asn_DEF_UTF8String,
@@ -952,7 +1381,7 @@
 		.default_value = 0,
 		.name = "ut-c"
 		},
-	{ ATF_POINTER, 4, offsetof(struct PDU, ut_ce),
+	{ ATF_POINTER, 14, offsetof(struct PDU, ut_ce),
 		.tag = (ASN_TAG_CLASS_CONTEXT | (17 << 2)),
 		.tag_mode = -1,	/* IMPLICIT tag at current level */
 		.type = &asn_DEF_UTF8String,
@@ -961,7 +1390,7 @@
 		.default_value = 0,
 		.name = "ut-ce"
 		},
-	{ ATF_POINTER, 3, offsetof(struct PDU, ut_ir),
+	{ ATF_POINTER, 13, offsetof(struct PDU, ut_ir),
 		.tag = (ASN_TAG_CLASS_CONTEXT | (18 << 2)),
 		.tag_mode = -1,	/* IMPLICIT tag at current level */
 		.type = &asn_DEF_UTF8String,
@@ -970,9 +1399,99 @@
 		.default_value = 0,
 		.name = "ut-ir"
 		},
-	{ ATF_POINTER, 2, offsetof(struct PDU, real),
+	{ ATF_POINTER, 12, offsetof(struct PDU, bm),
 		.tag = (ASN_TAG_CLASS_CONTEXT | (19 << 2)),
 		.tag_mode = -1,	/* IMPLICIT tag at current level */
+		.type = &asn_DEF_BMPString,
+		.memb_constraints = 0,	/* Defer constraints checking to the member type */
+		.per_constraints = 0,	/* No PER visible constraints */
+		.default_value = 0,
+		.name = "bm"
+		},
+	{ ATF_POINTER, 11, offsetof(struct PDU, bm_c),
+		.tag = (ASN_TAG_CLASS_CONTEXT | (20 << 2)),
+		.tag_mode = -1,	/* IMPLICIT tag at current level */
+		.type = &asn_DEF_BMPString,
+		.memb_constraints = memb_bm_c_constraint_1,
+		.per_constraints = &asn_PER_memb_bm_c_constr_23,
+		.default_value = 0,
+		.name = "bm-c"
+		},
+	{ ATF_POINTER, 10, offsetof(struct PDU, bm_cs),
+		.tag = (ASN_TAG_CLASS_CONTEXT | (21 << 2)),
+		.tag_mode = -1,	/* IMPLICIT tag at current level */
+		.type = &asn_DEF_BMPString,
+		.memb_constraints = memb_bm_cs_constraint_1,
+		.per_constraints = &asn_PER_memb_bm_cs_constr_24,
+		.default_value = 0,
+		.name = "bm-cs"
+		},
+	{ ATF_POINTER, 9, offsetof(struct PDU, bm_ce),
+		.tag = (ASN_TAG_CLASS_CONTEXT | (22 << 2)),
+		.tag_mode = -1,	/* IMPLICIT tag at current level */
+		.type = &asn_DEF_BMPString,
+		.memb_constraints = memb_bm_ce_constraint_1,
+		.per_constraints = &asn_PER_memb_bm_ce_constr_25,
+		.default_value = 0,
+		.name = "bm-ce"
+		},
+	{ ATF_POINTER, 8, offsetof(struct PDU, bm_ir),
+		.tag = (ASN_TAG_CLASS_CONTEXT | (23 << 2)),
+		.tag_mode = -1,	/* IMPLICIT tag at current level */
+		.type = &asn_DEF_BMPString,
+		.memb_constraints = memb_bm_ir_constraint_1,
+		.per_constraints = &asn_PER_memb_bm_ir_constr_26,
+		.default_value = 0,
+		.name = "bm-ir"
+		},
+	{ ATF_POINTER, 7, offsetof(struct PDU, us),
+		.tag = (ASN_TAG_CLASS_CONTEXT | (24 << 2)),
+		.tag_mode = -1,	/* IMPLICIT tag at current level */
+		.type = &asn_DEF_UniversalString,
+		.memb_constraints = 0,	/* Defer constraints checking to the member type */
+		.per_constraints = 0,	/* No PER visible constraints */
+		.default_value = 0,
+		.name = "us"
+		},
+	{ ATF_POINTER, 6, offsetof(struct PDU, us_c),
+		.tag = (ASN_TAG_CLASS_CONTEXT | (25 << 2)),
+		.tag_mode = -1,	/* IMPLICIT tag at current level */
+		.type = &asn_DEF_UniversalString,
+		.memb_constraints = memb_us_c_constraint_1,
+		.per_constraints = &asn_PER_memb_us_c_constr_28,
+		.default_value = 0,
+		.name = "us-c"
+		},
+	{ ATF_POINTER, 5, offsetof(struct PDU, us_cs),
+		.tag = (ASN_TAG_CLASS_CONTEXT | (26 << 2)),
+		.tag_mode = -1,	/* IMPLICIT tag at current level */
+		.type = &asn_DEF_UniversalString,
+		.memb_constraints = memb_us_cs_constraint_1,
+		.per_constraints = &asn_PER_memb_us_cs_constr_29,
+		.default_value = 0,
+		.name = "us-cs"
+		},
+	{ ATF_POINTER, 4, offsetof(struct PDU, us_ce),
+		.tag = (ASN_TAG_CLASS_CONTEXT | (27 << 2)),
+		.tag_mode = -1,	/* IMPLICIT tag at current level */
+		.type = &asn_DEF_UniversalString,
+		.memb_constraints = memb_us_ce_constraint_1,
+		.per_constraints = &asn_PER_memb_us_ce_constr_30,
+		.default_value = 0,
+		.name = "us-ce"
+		},
+	{ ATF_POINTER, 3, offsetof(struct PDU, us_ir),
+		.tag = (ASN_TAG_CLASS_CONTEXT | (28 << 2)),
+		.tag_mode = -1,	/* IMPLICIT tag at current level */
+		.type = &asn_DEF_UniversalString,
+		.memb_constraints = memb_us_ir_constraint_1,
+		.per_constraints = &asn_PER_memb_us_ir_constr_31,
+		.default_value = 0,
+		.name = "us-ir"
+		},
+	{ ATF_POINTER, 2, offsetof(struct PDU, real),
+		.tag = (ASN_TAG_CLASS_CONTEXT | (29 << 2)),
+		.tag_mode = -1,	/* IMPLICIT tag at current level */
 		.type = &asn_DEF_REAL,
 		.memb_constraints = 0,	/* Defer constraints checking to the member type */
 		.per_constraints = 0,	/* No PER visible constraints */
@@ -980,7 +1499,7 @@
 		.name = "real"
 		},
 	{ ATF_POINTER, 1, offsetof(struct PDU, oid),
-		.tag = (ASN_TAG_CLASS_CONTEXT | (20 << 2)),
+		.tag = (ASN_TAG_CLASS_CONTEXT | (30 << 2)),
 		.tag_mode = -1,	/* IMPLICIT tag at current level */
 		.type = &asn_DEF_OBJECT_IDENTIFIER,
 		.memb_constraints = 0,	/* Defer constraints checking to the member type */
@@ -989,7 +1508,7 @@
 		.name = "oid"
 		},
 };
-static int asn_MAP_PDU_oms_1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 };
+static int asn_MAP_PDU_oms_1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 };
 static ber_tlv_tag_t asn_DEF_PDU_tags_1[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
 };
@@ -1013,16 +1532,26 @@
     { (ASN_TAG_CLASS_CONTEXT | (16 << 2)), 16, 0, 0 }, /* ut-c at 31 */
     { (ASN_TAG_CLASS_CONTEXT | (17 << 2)), 17, 0, 0 }, /* ut-ce at 32 */
     { (ASN_TAG_CLASS_CONTEXT | (18 << 2)), 18, 0, 0 }, /* ut-ir at 33 */
-    { (ASN_TAG_CLASS_CONTEXT | (19 << 2)), 19, 0, 0 }, /* real at 34 */
-    { (ASN_TAG_CLASS_CONTEXT | (20 << 2)), 20, 0, 0 } /* oid at 35 */
+    { (ASN_TAG_CLASS_CONTEXT | (19 << 2)), 19, 0, 0 }, /* bm at 34 */
+    { (ASN_TAG_CLASS_CONTEXT | (20 << 2)), 20, 0, 0 }, /* bm-c at 35 */
+    { (ASN_TAG_CLASS_CONTEXT | (21 << 2)), 21, 0, 0 }, /* bm-cs at 36 */
+    { (ASN_TAG_CLASS_CONTEXT | (22 << 2)), 22, 0, 0 }, /* bm-ce at 37 */
+    { (ASN_TAG_CLASS_CONTEXT | (23 << 2)), 23, 0, 0 }, /* bm-ir at 38 */
+    { (ASN_TAG_CLASS_CONTEXT | (24 << 2)), 24, 0, 0 }, /* us at 39 */
+    { (ASN_TAG_CLASS_CONTEXT | (25 << 2)), 25, 0, 0 }, /* us-c at 40 */
+    { (ASN_TAG_CLASS_CONTEXT | (26 << 2)), 26, 0, 0 }, /* us-cs at 41 */
+    { (ASN_TAG_CLASS_CONTEXT | (27 << 2)), 27, 0, 0 }, /* us-ce at 42 */
+    { (ASN_TAG_CLASS_CONTEXT | (28 << 2)), 28, 0, 0 }, /* us-ir at 43 */
+    { (ASN_TAG_CLASS_CONTEXT | (29 << 2)), 29, 0, 0 }, /* real at 44 */
+    { (ASN_TAG_CLASS_CONTEXT | (30 << 2)), 30, 0, 0 } /* oid at 45 */
 };
 static asn_SEQUENCE_specifics_t asn_SPC_PDU_specs_1 = {
 	sizeof(struct PDU),
 	offsetof(struct PDU, _asn_ctx),
 	asn_MAP_PDU_tag2el_1,
-	21,	/* Count of tags in the map */
+	31,	/* Count of tags in the map */
 	asn_MAP_PDU_oms_1,	/* Optional members */
-	21, 0,	/* Root/Additions */
+	31, 0,	/* Root/Additions */
 	-1,	/* Start extensions */
 	-1	/* Stop extensions */
 };
@@ -1047,7 +1576,7 @@
 		/sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */
 	0,	/* No PER visible constraints */
 	asn_MBR_PDU_1,
-	21,	/* Elements count */
+	31,	/* Elements count */
 	&asn_SPC_PDU_specs_1	/* Additional specs */
 };