1 /*****************************************************************************
3 # Copyright 2019 AT&T Intellectual Property *
5 # Licensed under the Apache License, Version 2.0 (the "License"); *
6 # you may not use this file except in compliance with the License. *
7 # You may obtain a copy of the License at *
9 # http://www.apache.org/licenses/LICENSE-2.0 *
11 # Unless required by applicable law or agreed to in writing, software *
12 # distributed under the License is distributed on an "AS IS" BASIS, *
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
14 # See the License for the specific language governing permissions and *
15 # limitations under the License. *
17 ******************************************************************************/
20 * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
21 * Redistribution and modifications are permitted subject to BSD license.
23 #ifndef _BIT_STRING_H_
24 #define _BIT_STRING_H_
26 #include <OCTET_STRING.h> /* Some help from OCTET STRING */
32 typedef struct BIT_STRING_s {
33 uint8_t *buf; /* BIT STRING body */
34 size_t size; /* Size of the above buffer */
36 int bits_unused;/* Unused trailing bits in the last octet (0..7) */
38 asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */
41 extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING;
42 extern asn_TYPE_operation_t asn_OP_BIT_STRING;
43 extern asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs;
45 asn_struct_print_f BIT_STRING_print; /* Human-readable output */
46 asn_struct_compare_f BIT_STRING_compare;
47 asn_constr_check_f BIT_STRING_constraint;
48 xer_type_encoder_f BIT_STRING_encode_xer;
49 oer_type_decoder_f BIT_STRING_decode_oer;
50 oer_type_encoder_f BIT_STRING_encode_oer;
51 per_type_decoder_f BIT_STRING_decode_uper;
52 per_type_encoder_f BIT_STRING_encode_uper;
53 asn_random_fill_f BIT_STRING_random_fill;
55 #define BIT_STRING_free OCTET_STRING_free
56 #define BIT_STRING_decode_ber OCTET_STRING_decode_ber
57 #define BIT_STRING_encode_der OCTET_STRING_encode_der
58 #define BIT_STRING_decode_xer OCTET_STRING_decode_xer_binary
59 #define BIT_STRING_decode_aper OCTET_STRING_decode_aper
60 #define BIT_STRING_encode_aper OCTET_STRING_encode_aper
66 #endif /* _BIT_STRING_H_ */