decode SET OF in OER
diff --git a/skeletons/Makefile.am b/skeletons/Makefile.am
index 3cc18f4..4b36622 100644
--- a/skeletons/Makefile.am
+++ b/skeletons/Makefile.am
@@ -72,6 +72,7 @@
 	constr_SEQUENCE_OF.c constr_SEQUENCE_OF.h	\
 	constr_SET.c constr_SET.h			\
 	constr_SET_OF.c constr_SET_OF.h			\
+	constr_SET_OF_oer.c 			\
 	constr_TYPE.c constr_TYPE.h			\
 	constraints.c constraints.h			\
 	der_encoder.c der_encoder.h			\
diff --git a/skeletons/NativeInteger_oer.c b/skeletons/NativeInteger_oer.c
index 08cb6a6..25794e2 100644
--- a/skeletons/NativeInteger_oer.c
+++ b/skeletons/NativeInteger_oer.c
@@ -41,23 +41,23 @@
 
     if(specs && specs->field_unsigned) {
         unsigned long ul;
-        if(asn_INTEGER2ulong(&tmpint, &ul) != 0) {
-            ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
-            rval.code = RC_FAIL;
-            rval.consumed = 0;
-            return rval;
-        } else {
+        int ok = asn_INTEGER2ulong(&tmpint, &ul) == 0;
+        ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+        if(ok) {
             *native = ul;
+        } else {
+            rval.code = RC_FAIL;
+            return rval;
         }
     } else {
         long l;
-        if(asn_INTEGER2long(&tmpint, &l) != 0) {
-            ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
-            rval.code = RC_FAIL;
-            rval.consumed = 0;
-            return rval;
-        } else {
+        int ok = asn_INTEGER2long(&tmpint, &l) == 0;
+        ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+        if(ok) {
             *native = l;
+        } else {
+            rval.code = RC_FAIL;
+            return rval;
         }
     }
 
diff --git a/skeletons/constr_CHOICE_oer.c b/skeletons/constr_CHOICE_oer.c
index b14e6cf..a0feaa0 100644
--- a/skeletons/constr_CHOICE_oer.c
+++ b/skeletons/constr_CHOICE_oer.c
@@ -15,6 +15,7 @@
 #undef  RETURN
 #define RETURN(_code)                    \
     do {                                 \
+        asn_dec_rval_t rval;             \
         rval.code = _code;               \
         rval.consumed = consumed_myself; \
         return rval;                     \
@@ -38,7 +39,12 @@
         ctx->phase++;   \
         ctx->step = 0;  \
     } while(0)
-
+#undef  SET_PHASE
+#define SET_PHASE(ctx, value) \
+    do {                      \
+        ctx->phase = value;   \
+        ctx->step = 0;        \
+    } while(0)
 
 /*
  * Tags are canonically sorted in the tag to member table.
@@ -136,8 +142,6 @@
     void *st = *struct_ptr; /* Target structure. */
     asn_struct_ctx_t *ctx;  /* Decoder context */
 
-    asn_dec_rval_t rval;   /* Return code from subparsers */
-
     ssize_t consumed_myself = 0; /* Consumed bytes from ptr */
 
     (void)constraints;
@@ -196,7 +200,9 @@
                 RETURN(RC_FAIL);
             } else {
                 /* Skip open type extension */
-                ASN_DEBUG("Not implemented skipping open type extension");
+                ASN_DEBUG(
+                    "Not implemented skipping open type extension for tag %s",
+                    ber_tlv_tag_string(tlv_tag));
                 RETURN(RC_FAIL);
             }
         } while(0);
@@ -204,10 +210,12 @@
 
         ADVANCE(tag_len);
     }
+        /* Fall through */
     case 1: {
         asn_TYPE_member_t *elm = &elements[ctx->step]; /* CHOICE's element */
         void *memb_ptr;         /* Pointer to the member */
         void **memb_ptr2;       /* Pointer to that pointer */
+        asn_dec_rval_t rval;
 
         /*
          * Compute the position of the member inside a structure,
@@ -240,8 +248,22 @@
                                           elm->oer_constraints, memb_ptr2, ptr,
                                           size);
         rval.consumed += consumed_myself;
+        switch(rval.code) {
+        case RC_OK:
+            NEXT_PHASE(ctx);
+        case RC_WMORE:
+            break;
+        case RC_FAIL:
+            SET_PHASE(ctx, 3);  /* => 3 */
+        }
         return rval;
     }
+    case 2:
+        /* Already decoded everything */
+        RETURN(RC_OK);
+    case 3:
+        /* Failed to decode, after all */
+        RETURN(RC_FAIL);
     }
 
     RETURN(RC_FAIL);
diff --git a/skeletons/constr_SEQUENCE_OF.c b/skeletons/constr_SEQUENCE_OF.c
index 617dc2e..d267c3f 100644
--- a/skeletons/constr_SEQUENCE_OF.c
+++ b/skeletons/constr_SEQUENCE_OF.c
@@ -220,8 +220,8 @@
 	0,
 	0,
 #else
-	0,
-	0,
+	SEQUENCE_OF_decode_oer,
+	SEQUENCE_OF_encode_oer,
 #endif  /* ASN_DISABLE_OER_SUPPORT */
 #ifdef ASN_DISABLE_PER_SUPPORT
 	0,
diff --git a/skeletons/constr_SEQUENCE_OF.h b/skeletons/constr_SEQUENCE_OF.h
index d0a09eb..22d816b 100644
--- a/skeletons/constr_SEQUENCE_OF.h
+++ b/skeletons/constr_SEQUENCE_OF.h
@@ -23,6 +23,8 @@
 #define	SEQUENCE_OF_decode_ber	SET_OF_decode_ber
 #define	SEQUENCE_OF_decode_xer	SET_OF_decode_xer
 #define	SEQUENCE_OF_decode_uper	SET_OF_decode_uper
+#define	SEQUENCE_OF_decode_oer  SET_OF_decode_oer
+#define	SEQUENCE_OF_encode_oer  SET_OF_encode_oer
 der_type_encoder_f SEQUENCE_OF_encode_der;
 xer_type_encoder_f SEQUENCE_OF_encode_xer;
 per_type_encoder_f SEQUENCE_OF_encode_uper;
diff --git a/skeletons/constr_SET_OF.c b/skeletons/constr_SET_OF.c
index b4b8bb1..f2a711b 100644
--- a/skeletons/constr_SET_OF.c
+++ b/skeletons/constr_SET_OF.c
@@ -981,8 +981,13 @@
 	SET_OF_encode_der,
 	SET_OF_decode_xer,
 	SET_OF_encode_xer,
+#ifdef ASN_DISABLE_OER_SUPPORT
 	0,
 	0,
+#else
+	SET_OF_decode_oer,
+	SET_OF_decode_oer,
+#endif
 #ifdef ASN_DISABLE_PER_SUPPORT
 	0,
 	0,
diff --git a/skeletons/constr_SET_OF.h b/skeletons/constr_SET_OF.h
index a6bfb3c..8b51611 100644
--- a/skeletons/constr_SET_OF.h
+++ b/skeletons/constr_SET_OF.h
@@ -2,8 +2,8 @@
  * Copyright (c) 2003 Lev Walkin <vlm@lionet.info>. All rights reserved.
  * Redistribution and modifications are permitted subject to BSD license.
  */
-#ifndef	_CONSTR_SET_OF_H_
-#define	_CONSTR_SET_OF_H_
+#ifndef	CONSTR_SET_OF_H
+#define	CONSTR_SET_OF_H
 
 #include <asn_application.h>
 
@@ -12,14 +12,14 @@
 #endif
 
 typedef const struct asn_SET_OF_specifics_s {
-	/*
-	 * Target structure description.
-	 */
-	int struct_size;	/* Size of the target structure. */
-	int ctx_offset;		/* Offset of the asn_struct_ctx_t member */
+    /*
+     * Target structure description.
+     */
+    unsigned struct_size;       /* Size of the target structure. */
+    unsigned ctx_offset;        /* Offset of the asn_struct_ctx_t member */
 
-	/* XER-specific stuff */
-	int as_XMLValueList;	/* The member type must be encoded like this */
+    /* XER-specific stuff */
+    int as_XMLValueList; /* The member type must be encoded like this */
 } asn_SET_OF_specifics_t;
 
 /*
@@ -33,6 +33,8 @@
 der_type_encoder_f SET_OF_encode_der;
 xer_type_decoder_f SET_OF_decode_xer;
 xer_type_encoder_f SET_OF_encode_xer;
+oer_type_decoder_f SET_OF_decode_oer;
+oer_type_encoder_f SET_OF_encode_oer;
 per_type_decoder_f SET_OF_decode_uper;
 per_type_encoder_f SET_OF_encode_uper;
 extern asn_TYPE_operation_t asn_OP_SET_OF;
@@ -41,4 +43,4 @@
 }
 #endif
 
-#endif	/* _CONSTR_SET_OF_H_ */
+#endif	/* CONSTR_SET_OF_H */
diff --git a/skeletons/file-dependencies b/skeletons/file-dependencies
index dc82eb8..d9a48d8 100644
--- a/skeletons/file-dependencies
+++ b/skeletons/file-dependencies
@@ -78,5 +78,6 @@
 NativeEnumerated_oer.c
 constr_SEQUENCE_oer.c
 constr_CHOICE_oer.c
+constr_SET_OF_oer.c
 
 CODEC-PER:			# THIS IS A SPECIAL SECTION