14#include "ws_symbol_export.h"
84#define ASN1_CTX_SIGNATURE 0x41435458
130 unsigned (*ber_callback)(
bool imp_tag,
tvbuff_t *tvb,
unsigned offset,
142 unsigned (*type_cb)(
tvbuff_t *tvb, uint32_t offset,
205#define ROSE_CTX_SIGNATURE 0x524F5345
385WS_DLL_PUBLIC
double asn1_get_real(
const uint8_t *real_ptr,
int len,
int *err);
388#define ASN1_EXT_ROOT 0x01
389#define ASN1_EXT_EXT 0x02
391#define ASN1_DFLT 0x08
393#define ASN1_HAS_EXT(f) ((f)&(ASN1_EXT_ROOT|ASN1_EXT_EXT))
asn1_enc_e
Identifies the ASN.1 transfer syntax encoding used for a PDU.
Definition asn1.h:19
@ ASN1_ENC_PER
Definition asn1.h:21
@ ASN1_ENC_ECN
Definition asn1.h:22
@ ASN1_ENC_OER
Definition asn1.h:24
@ ASN1_ENC_BER
Definition asn1.h:20
@ ASN1_ENC_XER
Definition asn1.h:23
WS_DLL_PUBLIC void rose_ctx_init(rose_ctx_t *rctx)
Initialize a ROSE context.
Definition asn1.c:151
asn1_par_type
Identifies the kind of an ASN.1 parameterized type argument.
Definition asn1.h:41
@ ASN1_PAR_BOOLEAN
Definition asn1.h:43
@ ASN1_PAR_TYPE
Definition asn1.h:45
@ ASN1_PAR_IRR
Definition asn1.h:42
@ ASN1_PAR_INTEGER
Definition asn1.h:44
void asn1_ctx_clean_epdv(asn1_ctx_t *actx)
Clean the EPDV data of an ASN.1 context.
Definition asn1.c:46
struct _asn1_stack_frame_t asn1_stack_frame_t
Single frame on the ASN.1 parameterized type resolution stack.
struct _asn1_par_def_t asn1_par_def_t
Static definition of a single ASN.1 parameterized type parameter (name + kind).
bool asn1_param_get_boolean(asn1_ctx_t *actx, const char *name)
Get a named boolean parameter from the ASN.1 context.
Definition asn1.c:132
WS_DLL_PUBLIC void asn1_stack_frame_check(asn1_ctx_t *actx, const char *name, const asn1_par_def_t *par_def)
Check that the current stack frame matches the expected name and parameter definitions.
Definition asn1.c:70
WS_DLL_PUBLIC void asn1_param_push_boolean(asn1_ctx_t *actx, bool value)
Push a boolean parameter onto the ASN.1 context parameter stack.
Definition asn1.c:116
WS_DLL_PUBLIC void asn1_stack_frame_pop(asn1_ctx_t *actx, const char *name)
Pop a stack frame from the ASN.1 context.
Definition asn1.c:64
WS_DLL_PUBLIC void asn1_param_push_integer(asn1_ctx_t *actx, int32_t value)
Push an integer parameter onto the ASN.1 context parameter stack.
Definition asn1.c:124
asn1_cb_variant
Identifies the variant of an ASN.1 callback registered for a type.
Definition asn1.h:31
@ CB_NEW_DISSECTOR
Definition asn1.h:33
@ CB_ASN1_ENC
Definition asn1.h:32
@ CB_DISSECTOR_HANDLE
Definition asn1.h:34
WS_DLL_PUBLIC double asn1_get_real(const uint8_t *real_ptr, int len, int *err)
Convert an ASN.1 encoded real value to a double.
Definition asn1.c:208
WS_DLL_PUBLIC void asn1_stack_frame_push(asn1_ctx_t *actx, const char *name)
Push a stack frame onto the ASN.1 context.
Definition asn1.c:55
WS_DLL_PUBLIC bool asn1_ctx_check_signature(asn1_ctx_t *actx)
Check the signature of an ASN.1 context.
Definition asn1.c:36
struct _rose_ctx_t rose_ctx_t
Context object carrying per-association state for ROSE (Remote Operations Service Element) dissection...
struct _asn1_par_t asn1_par_t
Runtime instance of a resolved ASN.1 parameterized type argument.
WS_DLL_PUBLIC void rose_ctx_clean_data(rose_ctx_t *rctx)
Clean the data of a ROSE context.
Definition asn1.c:160
WS_DLL_PUBLIC rose_ctx_t * get_rose_ctx(void *ptr)
Retrieve the ROSE context from an opaque pointer.
Definition asn1.c:174
WS_DLL_PUBLIC int32_t asn1_param_get_integer(asn1_ctx_t *actx, const char *name)
Get a named integer parameter from the ASN.1 context.
Definition asn1.c:140
struct _asn1_ctx_t asn1_ctx_t
Central context object threaded through all ASN.1 dissection calls.
bool rose_ctx_check_signature(rose_ctx_t *rctx)
Check the signature of a ROSE context.
Definition asn1.c:156
WS_DLL_PUBLIC asn1_ctx_t * get_asn1_ctx(void *ptr)
Retrieve the ASN.1 context from an opaque pointer.
Definition asn1.c:165
WS_DLL_PUBLIC void asn1_ctx_init(asn1_ctx_t *actx, asn1_enc_e encoding, bool aligned, packet_info *pinfo)
Initialize an ASN.1 context.
Definition asn1.c:28
WS_DLL_PUBLIC void asn1_ctx_clean_external(asn1_ctx_t *actx)
Clean the external data of an ASN.1 context.
Definition asn1.c:40
Central context object threaded through all ASN.1 dissection calls.
Definition asn1.h:93
struct _asn1_ctx_t::@9 external
Decoding state for ASN.1 EXTERNAL type values.
struct _asn1_ctx_t::@10 subtree
Protocol subtree pointers for building nested dissection trees.
unsigned(* type_cb)(tvbuff_t *tvb, uint32_t offset, struct _asn1_ctx_t *actx, proto_tree *tree, int hf_index)
PER callback to dissect the contained EXTERNAL value.
Definition asn1.h:142
packet_info * pinfo
Definition asn1.h:97
tvbuff_t * arbitrary
Definition asn1.h:118
struct _rose_ctx_t * rose_ctx
Definition asn1.h:200
struct _asn1_ctx_t::@9::@12::@14 per
asn1_enc_e encoding
Definition asn1.h:95
const char * abstract_syntax
Definition asn1.h:168
tvbuff_t * data_value_descriptor
Definition asn1.h:111
proto_tree * top_tree
Definition asn1.h:153
struct _asn1_ctx_t::@11 embedded_pdv
Decoding state for ASN.1 EMBEDDED PDV type values.
struct _asn1_ctx_t::@9::@12::@13 ber
int32_t presentation_context_id
Definition asn1.h:167
int encoding
Definition asn1.h:114
const char * direct_reference
Definition asn1.h:112
int32_t indirect_reference
Definition asn1.h:113
struct _asn1_stack_frame_t * stack
Definition asn1.h:99
void * private_data
Definition asn1.h:101
int identification
Definition asn1.h:164
tvbuff_t * single_asn1_type
Definition asn1.h:116
int hf_index
Definition asn1.h:107
const char * transfer_syntax
Definition asn1.h:169
void * tree_ctx
Definition asn1.h:154
void * value_ptr
Definition asn1.h:100
bool indirect_ref_present
Definition asn1.h:110
bool aligned
Definition asn1.h:96
unsigned(* ber_callback)(bool imp_tag, tvbuff_t *tvb, unsigned offset, struct _asn1_ctx_t *actx, proto_tree *tree, int hf_index)
BER callback to dissect the contained EXTERNAL value.
Definition asn1.h:130
union _asn1_ctx_t::@9::@12 u
uint32_t signature
Definition asn1.h:94
bool direct_ref_present
Definition asn1.h:109
bool data_value_descr_present
Definition asn1.h:108
proto_tree * tree
Definition asn1.h:152
proto_item * created_item
Definition asn1.h:98
tvbuff_t * data_value
Definition asn1.h:170
tvbuff_t * octet_aligned
Definition asn1.h:117
Static definition of a single ASN.1 parameterized type parameter (name + kind).
Definition asn1.h:52
const char * name
Definition asn1.h:53
asn1_par_type ptype
Definition asn1.h:54
Runtime instance of a resolved ASN.1 parameterized type argument.
Definition asn1.h:61
asn1_par_type ptype
Definition asn1.h:63
const char * name
Definition asn1.h:62
union _asn1_par_t::@8 value
void * v_type
Definition asn1.h:67
struct _asn1_par_t * next
Definition asn1.h:69
bool v_boolean
Definition asn1.h:65
int32_t v_integer
Definition asn1.h:66
Single frame on the ASN.1 parameterized type resolution stack.
Definition asn1.h:76
struct _asn1_par_t * par
Definition asn1.h:78
struct _asn1_stack_frame_t * next
Definition asn1.h:79
const char * name
Definition asn1.h:77
Represents the metadata and indexing information for a single captured frame.
Definition packet_info.h:43
Context object carrying per-association state for ROSE (Remote Operations Service Element) dissection...
Definition asn1.h:214
int code
Definition asn1.h:232
dissector_table_t res_local_dissector_table
Definition asn1.h:219
dissector_table_t err_global_dissector_table
Definition asn1.h:220
int apdu_depth
Definition asn1.h:222
uint32_t signature
Definition asn1.h:215
size_t fillin_buf_size
Definition asn1.h:225
void * private_data
Definition asn1.h:238
dissector_table_t res_global_dissector_table
Definition asn1.h:218
struct _rose_ctx_t::@18 d
Transient per-APDU state, refreshed for each ROSE PDU decoded.
dissector_table_t err_local_dissector_table
Definition asn1.h:221
bool fillin_info
Definition asn1.h:223
const char * code_global
Definition asn1.h:234
char * fillin_ptr
Definition asn1.h:224
dissector_table_t arg_local_dissector_table
Definition asn1.h:217
proto_item * code_item
Definition asn1.h:235
int32_t code_local
Definition asn1.h:233
int pdu
Definition asn1.h:231
dissector_table_t arg_global_dissector_table
Definition asn1.h:216
Core tvbuff (testy virtual buffer) structure representing a region of packet data,...
Definition tvbuff-int.h:95