Commit d88bea9b authored by Lev Walkin's avatar Lev Walkin

add OER SEQUENCE decoder

parent 98eabc1c
......@@ -63,6 +63,7 @@ libasn1cskeletons_la_SOURCES = \
ber_tlv_tag.c ber_tlv_tag.h \
constr_CHOICE.c constr_CHOICE.h \
constr_SEQUENCE.c constr_SEQUENCE.h \
constr_SEQUENCE_oer.c constr_SEQUENCE_oer.h \
constr_SEQUENCE_OF.c constr_SEQUENCE_OF.h \
constr_SET.c constr_SET.h \
constr_SET_OF.c constr_SET_OF.h \
......
......@@ -6,6 +6,7 @@
#define _CONSTR_SEQUENCE_H_
#include <asn_application.h>
#include <constr_SEQUENCE_oer.h>
#ifdef __cplusplus
extern "C" {
......
This diff is collapsed.
/*-
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#ifndef CONSTR_SEQUENCE_OER_H
#define CONSTR_SEQUENCE_OER_H
#ifdef __cplusplus
extern "C" {
#endif
#include <asn_application.h>
#include <asn_codecs.h>
oer_type_decoder_f SEQUENCE_decode_oer;
oer_type_encoder_f SEQUENCE_encode_oer;
#ifdef __cplusplus
}
#endif
#endif /* CONSTR_SEQUENCE_OER_H */
......@@ -2,8 +2,8 @@
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#ifndef _OER_DECODER_H_
#define _OER_DECODER_H_
#ifndef OER_DECODER_H
#define OER_DECODER_H
#include <asn_application.h>
#include <oer_support.h>
......@@ -37,8 +37,30 @@ typedef asn_dec_rval_t(oer_type_decoder_f)(
const void *buf_ptr,
size_t size);
/*
* Swallow the Open Type (X.696 (08/2015), #30) into /dev/null.
* RETURN VALUES:
* 0: More data expected than bufptr contains.
* -1: Fatal error deciphering length.
* >0: Number of bytes used from bufptr.
*/
ssize_t oer_open_type_slurp(const void *bufptr, size_t size);
/*
* Read the Open Type (X.696 (08/2015), #30).
* RETURN VALUES:
* 0: More data expected than bufptr contains.
* -1: Fatal error deciphering length.
* >0: Number of bytes used from bufptr.
*/
ssize_t oer_open_type_get(asn_codec_ctx_t *opt_codec_ctx,
struct asn_TYPE_descriptor_s *td,
asn_oer_constraints_t *constraints, void **struct_ptr,
const void *bufptr, size_t size);
#ifdef __cplusplus
}
#endif
#endif /* _OER_DECODER_H_ */
#endif /* OER_DECODER_H */
......@@ -2,8 +2,8 @@
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#ifndef _OER_ENCODER_H_
#define _OER_ENCODER_H_
#ifndef OER_ENCODER_H
#define OER_ENCODER_H
#include <asn_application.h>
......@@ -48,4 +48,4 @@ typedef asn_enc_rval_t(oer_type_encoder_f)(
}
#endif
#endif /* _OER_ENCODER_H_ */
#endif /* OER_ENCODER_H */
......@@ -3,8 +3,8 @@
* All rights reserved.
* Redistribution and modifications are oermitted subject to BSD license.
*/
#ifndef _OER_SUPPORT_H_
#define _OER_SUPPORT_H_
#ifndef OER_SUPPORT_H
#define OER_SUPPORT_H
#include <asn_system.h> /* Platform-specific types */
......@@ -30,7 +30,7 @@ typedef const struct asn_oer_constraints_s {
/*
* Fetch the length determinant (X.696 08/2015, #8.6) into *len_r.
* Fetch the length determinant (X.696 (08/2015), #8.6) into *len_r.
* RETURN VALUES:
* 0: More data expected than bufptr contains.
* -1: Fatal error deciphering length.
......@@ -49,4 +49,4 @@ ssize_t oer_serialize_length(size_t length, asn_app_consume_bytes_f *cb, void *a
}
#endif
#endif /* _OER_SUPPORT_H_ */
#endif /* OER_SUPPORT_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment