blob: 2b19584851da25cd382d747f9ddbca2d9fd603c8 [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, Chiu1f87ac02017-08-20 01:25:45 +080024extern asn_TYPE_operation_t asn_OP_BIT_STRING;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080025extern asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs;
Lev Walkinf15320b2004-06-03 03:38:44 +000026
27asn_struct_print_f BIT_STRING_print; /* Human-readable output */
Lev Walkincd2f48e2017-08-10 02:14:59 -070028asn_struct_compare_f BIT_STRING_compare;
Lev Walkinf15320b2004-06-03 03:38:44 +000029asn_constr_check_f BIT_STRING_constraint;
Lev Walkina9cc46e2004-09-22 16:06:28 +000030xer_type_encoder_f BIT_STRING_encode_xer;
Lev Walkincfc16d32017-08-30 19:15:08 -070031oer_type_decoder_f BIT_STRING_decode_oer;
32oer_type_encoder_f BIT_STRING_encode_oer;
Lev Walkinf15320b2004-06-03 03:38:44 +000033
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080034#define BIT_STRING_free OCTET_STRING_free
35#define BIT_STRING_decode_ber OCTET_STRING_decode_ber
36#define BIT_STRING_encode_der OCTET_STRING_encode_der
37#define BIT_STRING_decode_xer OCTET_STRING_decode_xer_binary
38#define BIT_STRING_decode_uper OCTET_STRING_decode_uper
39#define BIT_STRING_encode_uper OCTET_STRING_encode_uper
40
Lev Walkin21b41ac2005-07-24 09:03:44 +000041#ifdef __cplusplus
42}
43#endif
44
Lev Walkinf15320b2004-06-03 03:38:44 +000045#endif /* _BIT_STRING_H_ */