summaryrefslogtreecommitdiffstats
path: root/src/VisibleString.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-07-20 00:03:44 +0200
committerHarald Welte <laforge@gnumonks.org>2010-07-20 00:03:44 +0200
commitec0e217b0647eb798576a7d3366b39c159c00624 (patch)
tree88404309798e2fac2844b4e76224b6ad1d7c5375 /src/VisibleString.c
parentb1e3ee75318536dac0a91817c5e4d35d61893ba6 (diff)
Update to asn1c official repository svn trunk r1409
Diffstat (limited to 'src/VisibleString.c')
-rw-r--r--src/VisibleString.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/VisibleString.c b/src/VisibleString.c
index 8796582..3487b6f 100644
--- a/src/VisibleString.c
+++ b/src/VisibleString.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2003 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Copyright (c) 2003, 2006 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#include <asn_internal.h>
@@ -12,6 +12,11 @@ static ber_tlv_tag_t asn_DEF_VisibleString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), /* [UNIVERSAL 26] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
+static asn_per_constraints_t asn_DEF_VisibleString_constraints = {
+ { APC_CONSTRAINED, 7, 7, 0x20, 0x7e }, /* Value */
+ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, /* Size */
+ 0, 0
+};
asn_TYPE_descriptor_t asn_DEF_VisibleString = {
"VisibleString",
"VisibleString",
@@ -22,7 +27,8 @@ asn_TYPE_descriptor_t asn_DEF_VisibleString = {
OCTET_STRING_encode_der,
OCTET_STRING_decode_xer_utf8,
OCTET_STRING_encode_xer_utf8,
- 0, 0,
+ OCTET_STRING_decode_uper,
+ OCTET_STRING_encode_uper,
0, /* Use generic outmost tag fetcher */
asn_DEF_VisibleString_tags,
sizeof(asn_DEF_VisibleString_tags)
@@ -30,7 +36,7 @@ asn_TYPE_descriptor_t asn_DEF_VisibleString = {
asn_DEF_VisibleString_tags,
sizeof(asn_DEF_VisibleString_tags)
/ sizeof(asn_DEF_VisibleString_tags[0]),
- 0, /* No PER visible constraints */
+ &asn_DEF_VisibleString_constraints,
0, 0, /* No members */
0 /* No specifics */
};
@@ -52,7 +58,7 @@ VisibleString_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
*/
for(; buf < end; buf++) {
if(*buf < 0x20 || *buf > 0x7e) {
- _ASN_CTFAIL(app_key, td,
+ _ASN_CTFAIL(app_key, td, sptr,
"%s: value byte %ld (%d) "
"not in VisibleString alphabet (%s:%d)",
td->name,
@@ -63,7 +69,7 @@ VisibleString_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
}
}
} else {
- _ASN_CTFAIL(app_key, td,
+ _ASN_CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;