Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1 | /*- |
| 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 Walkin | bbd9325 | 2004-10-12 05:57:23 +0000 | [diff] [blame] | 8 | #include <OCTET_STRING.h> /* Some help from OCTET STRING */ |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 9 | |
Lev Walkin | 21b41ac | 2005-07-24 09:03:44 +0000 | [diff] [blame] | 10 | #ifdef __cplusplus |
| 11 | extern "C" { |
| 12 | #endif |
| 13 | |
Lev Walkin | bbd9325 | 2004-10-12 05:57:23 +0000 | [diff] [blame] | 14 | typedef struct BIT_STRING_s { |
| 15 | uint8_t *buf; /* BIT STRING body */ |
Lev Walkin | 494fb70 | 2017-08-07 20:07:00 -0700 | [diff] [blame] | 16 | size_t size; /* Size of the above buffer */ |
Lev Walkin | bbd9325 | 2004-10-12 05:57:23 +0000 | [diff] [blame] | 17 | |
| 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 Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 22 | |
Lev Walkin | 5e03376 | 2004-09-29 13:26:15 +0000 | [diff] [blame] | 23 | extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING; |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 24 | extern asn_TYPE_operation_t asn_OP_BIT_STRING; |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 25 | extern asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs; |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 26 | |
| 27 | asn_struct_print_f BIT_STRING_print; /* Human-readable output */ |
Lev Walkin | cd2f48e | 2017-08-10 02:14:59 -0700 | [diff] [blame] | 28 | asn_struct_compare_f BIT_STRING_compare; |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 29 | asn_constr_check_f BIT_STRING_constraint; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 30 | xer_type_encoder_f BIT_STRING_encode_xer; |
Lev Walkin | cfc16d3 | 2017-08-30 19:15:08 -0700 | [diff] [blame] | 31 | oer_type_decoder_f BIT_STRING_decode_oer; |
| 32 | oer_type_encoder_f BIT_STRING_encode_oer; |
Lev Walkin | a5b0288 | 2017-10-01 22:48:44 -0700 | [diff] [blame] | 33 | per_type_decoder_f BIT_STRING_decode_uper; |
| 34 | per_type_encoder_f BIT_STRING_encode_uper; |
Lev Walkin | a5972be | 2017-09-29 23:15:58 -0700 | [diff] [blame] | 35 | asn_random_fill_f BIT_STRING_random_fill; |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 36 | |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 37 | #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, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 41 | |
Lev Walkin | 21b41ac | 2005-07-24 09:03:44 +0000 | [diff] [blame] | 42 | #ifdef __cplusplus |
| 43 | } |
| 44 | #endif |
| 45 | |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 46 | #endif /* _BIT_STRING_H_ */ |