Index: /branches/rel_apv_10_7_2_17_bhel_h323_nat/usr/click/lib/libasn1c/Makefile
===================================================================
--- /branches/rel_apv_10_7_2_17_bhel_h323_nat/usr/click/lib/libasn1c/Makefile	(revision 39143)
+++ /branches/rel_apv_10_7_2_17_bhel_h323_nat/usr/click/lib/libasn1c/Makefile	(working copy)
@@ -7,19 +7,7 @@
 CFLAGS+= $(ASN_MODULE_CFLAGS) -DASN_EMIT_DEBUG=1 -DASN_PDU_COLLECTION -I.
 INCS = $(ASN_MODULE_HDRS)
 
-PROG_CFLAGS= -I. -I asn1c_skeletons
-PROG_LDADD= -L. -lasncodec
+SUBDIR+= test
+all: lib${LIB}.a 
 
-TEST1 = test/parse_connect_msg
-TEST2 = test/parse_setup_msg
-$(TEST1): test/parse_connect_msg.c lib$(LIB).a
-	$(CC) -o test/parse_connect_msg test/parse_connect_msg.c $(CFLAGS) $(PROG_CFLAGS) $(PROG_LDADD) $(LDADD)
-
-$(TEST2): test/parse_setup_msg.c lib$(LIB).a
-	$(CC) -o test/parse_setup_msg test/parse_setup_msg.c $(CFLAGS) $(PROG_CFLAGS) $(PROG_LDADD) $(LDADD)
-
-all: lib${LIB}.a ${TEST1} $(TEST2)
-
-clean:
-	rm -f lib${LIB}.a ${TEST1} $(TEST2) *.o
 .include <bsd.lib.mk>
Index: /branches/rel_apv_10_7_2_17_bhel_h323_nat/usr/click/lib/libasn1c/OCTET_STRING.c
===================================================================
--- /branches/rel_apv_10_7_2_17_bhel_h323_nat/usr/click/lib/libasn1c/OCTET_STRING.c	(revision 39143)
+++ /branches/rel_apv_10_7_2_17_bhel_h323_nat/usr/click/lib/libasn1c/OCTET_STRING.c	(working copy)
@@ -1220,9 +1220,8 @@
 		size_t units, unsigned int bpc, unsigned int unit_bits,
 		long lb, long ub, const asn_per_constraints_t *pc) {
 	uint8_t *end = buf + units * bpc;
-        int ret;
 
-	ASN_DEBUG("thExpanding %d characters into (%ld..%ld):%d",
+	ASN_DEBUG("Expanding %d characters into (%ld..%ld):%d",
 		(int)units, lb, ub, unit_bits);
 
 	/* X.691: 27.5.4 */
@@ -1231,7 +1230,6 @@
 		lb = 0;
 	} else if(pc && pc->code2value) {
 		if(unit_bits > 16)
-                        printf ("return1\n");
 			return 1;	/* FATAL: can't have constrained
 					 * UniversalString with more than
 					 * 16 million code points */
@@ -1244,7 +1242,6 @@
 				ASN_DEBUG("Code %d (0x%02x) is"
 					" not in map (%ld..%ld)",
 					code, code, lb, ub);
-                                printf ("ret here2\n");
 				return 1;	/* FATAL */
 			}
 			switch(bpc) {
@@ -1254,16 +1251,12 @@
 				buf[2] = value >> 8; buf[3] = value; break;
 			}
 		}
-        printf ("this buf2 : %s\n", buf);
 		return 0;
 	}
 
 	/* Shortcut the no-op copying to the aligned structure */
 	if(lb == 0 && (unit_bits == 8 * bpc)) {
-                printf ("return from her\n");
-		ret = per_get_many_bits(po, buf, 0, unit_bits * units); //ACP
-                buf[0] = 0x09;
-                return 0;
+		return per_get_many_bits(po, buf, 0, unit_bits * units);
 	}
 
 	for(; buf < end; buf += bpc) {
@@ -1282,7 +1275,6 @@
 			buf[2] = ch >> 8; buf[3] = ch; break;
 		}
 	}
-        printf ("this buf : %s\n", buf);
 
 	return 0;
 }
@@ -1492,7 +1484,7 @@
 		if(raw_len < 0) RETURN(RC_WMORE);
 		if(raw_len == 0 && st->buf) break;
 
-		ASN_DEBUG("OCT STR Got PER length eb %ld, len %ld, %s (%s)",
+		ASN_DEBUG("Got PER length eb %ld, len %ld, %s (%s)",
 			(long)csiz->effective_bits, (long)raw_len,
 			repeat ? "repeat" : "once", td->name);
         len_bytes = raw_len * bpc;
@@ -1704,9 +1696,9 @@
 	case ASN_OSUBV_ANY:
 	case ASN_OSUBV_STR:
 		canonical_unit_bits = unit_bits = 8;
-/* 		if(cval->flags & APC_CONSTRAINED)
+ 		if(cval->flags & APC_CONSTRAINED)
 			unit_bits = cval->range_bits;
-*/
+
 		bpc = OS__BPC_CHAR;
 		break;
 	case ASN_OSUBV_U16:
@@ -1805,8 +1797,7 @@
 		repeat = 0;
 		if(raw_len < 0) RETURN(RC_WMORE);
 		raw_len += csiz->lower_bound;
-
-		ASN_DEBUG("OCT str2 Got PER length eb %ld, len %ld, %s (%s)", //ACP
+		ASN_DEBUG("Got PER length eb %ld, len %ld, %s (%s)",
 			(long)csiz->effective_bits, (long)raw_len,
 			repeat ? "repeat" : "once", td->name);
 
@@ -1828,7 +1819,6 @@
 		p = REALLOC(st->buf, st->size + len_bytes + 1);
 		if(!p) RETURN(RC_FAIL);
 		st->buf = (uint8_t *)p;
-
 		if(bpc) {
 			ret = OCTET_STRING_per_get_characters(pd,
 				&st->buf[st->size], raw_len, bpc, unit_bits,
Index: /branches/rel_apv_10_7_2_17_bhel_h323_nat/usr/click/lib/libasn1c/test/Makefile
===================================================================
--- /branches/rel_apv_10_7_2_17_bhel_h323_nat/usr/click/lib/libasn1c/test/Makefile	(revision 0)
+++ /branches/rel_apv_10_7_2_17_bhel_h323_nat/usr/click/lib/libasn1c/test/Makefile	(working copy)
@@ -0,0 +1,16 @@
+LIB = asncodec
+LIBDIR = ..
+LDLIBS = -L$(LIBDIR) -l$(LIB)
+CFLAGS = -I.. -I../asn1c_skeletons
+
+TESTS = parse_connect_msg parse_setup_msg parse_setup_lab_msg
+
+all: $(TESTS)
+
+%: %.c $(LIBDIR)/lib$(LIB).a
+	$(CC) -o $@ $< $(CFLAGS) $(LDLIBS) -lm
+
+clean:
+	rm -f $(TESTS) *.o
+
+.include <bsd.prog.mk>
Index: /branches/rel_apv_10_7_2_17_bhel_h323_nat/usr/click/lib/libasn1c/test/parse_setup_lab_msg.c
===================================================================
--- /branches/rel_apv_10_7_2_17_bhel_h323_nat/usr/click/lib/libasn1c/test/parse_setup_lab_msg.c	(revision 0)
+++ /branches/rel_apv_10_7_2_17_bhel_h323_nat/usr/click/lib/libasn1c/test/parse_setup_lab_msg.c	(working copy)
@@ -0,0 +1,33 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include "Setup-UUIE.h"
+#include "Connect-UUIE.h"
+#include "per_decoder.h"
+#include "CallIdentifier.h"
+
+void parse_h225_setup(const uint8_t *data, size_t data_len) {
+    char ip_str[20];
+    asn_dec_rval_t rval;
+    Setup_UUIE_t  *setup_msg = NULL;
+    rval = aper_decode_complete(NULL, &asn_DEF_Setup_UUIE, (void **)&setup_msg, data, data_len);
+    if (rval.code == RC_OK) {
+        printf("H.225 Setup message decoded successfully!\n");
+        ASN_STRUCT_FREE(asn_DEF_Setup_UUIE, setup_msg);
+    } else {
+        fprintf(stderr, "Failed to decode H.225 Setup message.\n");
+    }
+ 
+}
+
+int main() {
+    uint8_t hex_data[] = {
+0xb8, 0x06, 0x00, 0x08, 0x91, 0x4a, 0x00, 0x05, 0x02, 0x40, 0x0f, 0x00, 0x42, 0x00, 0x53, 0x00, 0x57, 0x00, 0x41, 0x00, 0x4e, 0x00, 0x5f, 0x00, 0x2d, 0x00, 0x48, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x70, 0x00, 0x64, 0x00, 0x65, 0x00, 0x73, 0x00, 0x6b, 0x00, 0x31, 0x02, 0x80, 0x99, 0x95, 0x56, 0x22, 0xc0, 0xb5, 0x00, 0x23, 0x31, 0x27, 0x50, 0x6f, 0x6c, 0x79, 0x63, 0x6f, 0x6d, 0x20, 0x52, 0x65, 0x61, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x44, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x0b, 0x33, 0x2e, 0x31, 0x30, 0x2e, 0x34, 0x2e, 0x37, 0x32, 0x39, 0x32, 0x37, 0x00, 0x01, 0x02, 0x80, 0x49, 0x43, 0x34, 0x00, 0x73, 0xf4, 0x47, 0x18, 0x06, 0xb8, 0x00, 0x88, 0xec, 0xb9, 0xbe, 0x2e, 0x39, 0x00, 0x1f, 0x04, 0x92, 0x63, 0x60, 0x19, 0xde, 0xbf, 0x8d, 0x00, 0xd5, 0xcf, 0x98, 0x08, 0x07, 0x00, 0x0a, 0x0a, 0x64, 0xf0, 0x06, 0xb8, 0x11, 0x00, 0x3c, 0xe8, 0xb9, 0xbe, 0x2e, 0x39, 0x00, 0x1f, 0x04, 0x92, 0x63, 0x60, 0x19, 0xde, 0xbf, 0x8d, 0x02, 0x01, 0x20, 0x81, 0xaf, 0x03, 0x00, 0x00, 0x07, 0x00, 0x08, 0x81, 0x6b, 0x00, 0x03, 0x18, 0x10, 0x00, 0x07, 0x00, 0x08, 0x81, 0x6b, 0x00, 0x03, 0x28, 0x00, 0x02, 0x00, 0x77, 0x6a, 0x73, 0x64, 0x52, 0x76, 0x47, 0xf2, 0x2e, 0x6f, 0xd4, 0x03, 0x55, 0xfa, 0x83, 0x9a, 0x4a, 0x1f, 0xcc, 0x0d, 0x7a, 0x1c, 0x50, 0xfc, 0x8d, 0x50, 0x64, 0xb2, 0x56, 0xcd, 0x9b, 0x32, 0x3b, 0x48, 0xc4, 0x0a, 0x97, 0x54, 0x84, 0xee, 0xdf, 0x6d, 0xdb, 0x43, 0xb1, 0xfd, 0x60, 0x95, 0x59, 0xca, 0x83, 0xa8, 0x0d, 0xd4, 0x5f, 0xbb, 0x05, 0x12, 0x01, 0xa2, 0x76, 0x97, 0x1e, 0x78, 0x02, 0x00, 0x91, 0xcf, 0xd2, 0x25, 0xaa, 0x91, 0x4c, 0xcd, 0x35, 0x21, 0x95, 0x91, 0x4c, 0xe5, 0x8d, 0x20, 0x18, 0xa1, 0x61, 0x0a, 0xad, 0xcd, 0x41, 0x40, 0xa9, 0x51, 0x29, 0x33, 0xbe, 0xdb, 0x10, 0x60, 0x14, 0x69, 0x91, 0xe6, 0x1c, 0x1f, 0x4d, 0x5d, 0x25, 0x8e, 0x58, 0x13, 0x60, 0x50, 0x24, 0x88, 0x45, 0x3d, 0xfb, 0xb1, 0x19, 0x73,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x74, 0x02, 0x0b, 0xbe, 0xa6, 0x3b, 0x13, 0x9b, 0x22, 0x51, 0x4a, 0x08, 0x79, 0x8e, 0x34, 0x04, 0xdd, 0xef, 0x95, 0x19, 0xb3, 0xcd, 0x3a, 0x43, 0x1b, 0x30, 0x2b, 0x0a, 0x6d, 0xf2, 0x5f, 0x14, 0x37, 0x4f, 0xe1, 0x35, 0x6d, 0x6d, 0x51, 0xc2, 0x45, 0xe4, 0x85, 0xb5, 0x76, 0x62, 0x5e, 0x7e, 0xc6, 0xf4, 0x4c, 0x42, 0xe9, 0xa6, 0x37, 0xed, 0x6b, 0x0b, 0xff, 0x5c, 0xb6, 0xf4, 0x06, 0xb7, 0xed, 0xee, 0x38, 0x6b, 0xfb, 0x5a, 0x89, 0x9f, 0xa5, 0xae, 0x9f, 0x24, 0x11, 0x7c, 0x4b, 0x1f, 0xe6, 0x49, 0x28, 0x66, 0x51, 0xec, 0xe6, 0x53, 0x81, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x08, 0x02, 0x01, 0x00, 0x01, 0x00, 0x49, 0x46, 0x00, 0x31, 0x00, 0x64, 0x00, 0x32, 0x00, 0x34, 0x00, 0x66, 0x00, 0x35, 0x00, 0x61, 0x00, 0x39, 0x00, 0x2d, 0x00, 0x37, 0x00, 0x31, 0x00, 0x33, 0x00, 0x32, 0x00, 0x2d, 0x00, 0x34, 0x00, 0x35, 0x00, 0x65, 0x00, 0x38, 0x00, 0x2d, 0x00, 0x39, 0x00, 0x32, 0x00, 0x34, 0x00, 0x30, 0x00, 0x2d, 0x00, 0x66, 0x00, 0x37, 0x00, 0x63, 0x00, 0x62, 0x00, 0x66, 0x00, 0x64, 0x00, 0x61, 0x00, 0x34, 0x00, 0x33, 0x00, 0x34, 0x00, 0x65, 0x00, 0x34, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x40, 0x09, 0x01, 0x40, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x01
+    
+};
+    size_t data_len = sizeof(hex_data);
+    printf ("data len : %d\n", data_len);
+    parse_h225_setup(hex_data, data_len);
+    return 0;
+}
+
