2  * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
 
   3  * Redistribution and modifications are permitted subject to BSD license.
 
   8 #include <asn_system.h>         /* Platform-specific types */
 
  15  * Pre-computed OER constraints.
 
  17 typedef struct asn_oer_constraint_number_s {
 
  18     unsigned width;    /* ±8,4,2,1 fixed bytes */
 
  19     unsigned positive; /* 1 for unsigned number, 0 for signed */
 
  20 } asn_oer_constraint_number_t;
 
  21 typedef struct asn_oer_constraints_s {
 
  22     asn_oer_constraint_number_t value;
 
  23     ssize_t size;    /* -1 (no constraint) or >= 0 */
 
  24 } asn_oer_constraints_t;
 
  28  * Fetch the length determinant (X.696 (08/2015), #8.6) into *len_r.
 
  30  *       0:     More data expected than bufptr contains.
 
  31  *      -1:     Fatal error deciphering length.
 
  32  *      >0:     Number of bytes used from bufptr.
 
  34 ssize_t oer_fetch_length(const void *bufptr, size_t size, size_t *len_r);
 
  37  * Serialize OER length. Returns the number of bytes serialized
 
  38  * or -1 if a given callback returned with negative result.
 
  40 ssize_t oer_serialize_length(size_t length, asn_app_consume_bytes_f *cb, void *app_key);
 
  47 #endif  /* OER_SUPPORT_H */