blob: d66c88ecb46df16b92c9468e6aa204e93d3b7b3c [file] [log] [blame]
Lev Walkinf15320b2004-06-03 03:38:44 +00001/*-
2 * Copyright (c) 2003 Lev Walkin <vlm@lionet.info>. All rights reserved.
3 * Redistribution and modifications are permitted subject to BSD license.
4 */
5#ifndef _BIT_STRING_H_
6#define _BIT_STRING_H_
7
Lev Walkinbbd93252004-10-12 05:57:23 +00008#include <OCTET_STRING.h> /* Some help from OCTET STRING */
Lev Walkinf15320b2004-06-03 03:38:44 +00009
Lev Walkin21b41ac2005-07-24 09:03:44 +000010#ifdef __cplusplus
11extern "C" {
12#endif
13
Lev Walkinbbd93252004-10-12 05:57:23 +000014typedef struct BIT_STRING_s {
15 uint8_t *buf; /* BIT STRING body */
Lev Walkin494fb702017-08-07 20:07:00 -070016 size_t size; /* Size of the above buffer */
Lev Walkinbbd93252004-10-12 05:57:23 +000017
18 int bits_unused;/* Unused trailing bits in the last octet (0..7) */
19
20 asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */
21} BIT_STRING_t;
Lev Walkinf15320b2004-06-03 03:38:44 +000022
Lev Walkin5e033762004-09-29 13:26:15 +000023extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080024extern asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs;
Lev Walkinf15320b2004-06-03 03:38:44 +000025
26asn_struct_print_f BIT_STRING_print; /* Human-readable output */
Lev Walkincd2f48e2017-08-10 02:14:59 -070027asn_struct_compare_f BIT_STRING_compare;
Lev Walkinf15320b2004-06-03 03:38:44 +000028asn_constr_check_f BIT_STRING_constraint;
Lev Walkina9cc46e2004-09-22 16:06:28 +000029xer_type_encoder_f BIT_STRING_encode_xer;
Lev Walkinf15320b2004-06-03 03:38:44 +000030
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080031#define BIT_STRING_free OCTET_STRING_free
32#define BIT_STRING_decode_ber OCTET_STRING_decode_ber
33#define BIT_STRING_encode_der OCTET_STRING_encode_der
34#define BIT_STRING_decode_xer OCTET_STRING_decode_xer_binary
35#define BIT_STRING_decode_uper OCTET_STRING_decode_uper
36#define BIT_STRING_encode_uper OCTET_STRING_encode_uper
37
Lev Walkin21b41ac2005-07-24 09:03:44 +000038#ifdef __cplusplus
39}
40#endif
41
Lev Walkinf15320b2004-06-03 03:38:44 +000042#endif /* _BIT_STRING_H_ */