blob: bd2d23db01f5c1c89a80700291135c1c00cff0ff [file] [log] [blame]
Lev Walkinf15320b2004-06-03 03:38:44 +00001/*-
Lev Walkin20696a42017-10-17 21:27:33 -07002 * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
Lev Walkinf15320b2004-06-03 03:38:44 +00003 * 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 Walkina5b02882017-10-01 22:48:44 -070033per_type_decoder_f BIT_STRING_decode_uper;
34per_type_encoder_f BIT_STRING_encode_uper;
Lev Walkina5972be2017-09-29 23:15:58 -070035asn_random_fill_f BIT_STRING_random_fill;
Lev Walkinf15320b2004-06-03 03:38:44 +000036
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080037#define BIT_STRING_free OCTET_STRING_free
38#define BIT_STRING_decode_ber OCTET_STRING_decode_ber
39#define BIT_STRING_encode_der OCTET_STRING_encode_der
40#define BIT_STRING_decode_xer OCTET_STRING_decode_xer_binary
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080041
Lev Walkin21b41ac2005-07-24 09:03:44 +000042#ifdef __cplusplus
43}
44#endif
45
Lev Walkinf15320b2004-06-03 03:38:44 +000046#endif /* _BIT_STRING_H_ */