Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Attributes | List of all members
_asn1_ctx_t Struct Reference

Central context object threaded through all ASN.1 dissection calls. More...

#include <asn1.h>

Public Attributes

uint32_t signature
 
asn1_enc_e encoding
 
bool aligned
 
packet_infopinfo
 
proto_itemcreated_item
 
struct _asn1_stack_frame_tstack
 
void * value_ptr
 
void * private_data
 
struct { 
 
   int   hf_index 
 
   bool   data_value_descr_present 
 
   bool   direct_ref_present 
 
   bool   indirect_ref_present 
 
   tvbuff_t *   data_value_descriptor 
 
   const char *   direct_reference 
 
   int32_t   indirect_reference 
 
   int   encoding 
 
   tvbuff_t *   single_asn1_type 
 
   tvbuff_t *   octet_aligned 
 
   tvbuff_t *   arbitrary 
 
   union { 
 
      struct { 
 
         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. More...
 
      }   ber 
 
      struct { 
 
         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. More...
 
      }   per 
 
   }   u 
 
external 
 Decoding state for ASN.1 EXTERNAL type values.
 
struct { 
 
   proto_tree *   tree 
 
   proto_tree *   top_tree 
 
   void *   tree_ctx 
 
subtree 
 Protocol subtree pointers for building nested dissection trees.
 
struct { 
 
   int   hf_index 
 
   bool   data_value_descr_present 
 
   tvbuff_t *   data_value_descriptor 
 
   int   identification 
 
   int32_t   presentation_context_id 
 
   const char *   abstract_syntax 
 
   const char *   transfer_syntax 
 
   tvbuff_t *   data_value 
 
   union { 
 
      struct { 
 
         int(*   ber_callback )(bool imp_tag, tvbuff_t *tvb,
             int offset, struct
            _asn1_ctx_t *actx, proto_tree
            *tree, int hf_index) 
 BER callback to dissect the contained EMBEDDED PDV value. More...
 
      }   ber 
 
      struct { 
 
         int(*   type_cb )(tvbuff_t *tvb, int offset,
             struct _asn1_ctx_t *actx,
             proto_tree *tree, int
            hf_index) 
 PER callback to dissect the contained EMBEDDED PDV value. More...
 
      }   per 
 
   }   u 
 
embedded_pdv 
 Decoding state for ASN.1 EMBEDDED PDV type values.
 
struct _rose_ctx_trose_ctx
 

Detailed Description

Central context object threaded through all ASN.1 dissection calls.

Carries encoding parameters, packet metadata, the type-resolution stack, and per-PDU working state for EXTERNAL and EMBEDDED PDV types.

Member Data Documentation

◆ abstract_syntax

const char* _asn1_ctx_t::abstract_syntax

Abstract syntax OID string (when identification == 0 or 1), or NULL.

◆ aligned

bool _asn1_ctx_t::aligned

True if PER encoding is byte-aligned (relevant when encoding == ASN1_ENC_PER).

◆ arbitrary

tvbuff_t* _asn1_ctx_t::arbitrary

Buffer for arbitrary (bit-string) encoding, or NULL.

◆ [struct] [1/2]

struct { ... } _asn1_ctx_t::ber

BER-specific dissection callback.

◆ [struct] [2/2]

struct { ... } _asn1_ctx_t::ber

BER-specific dissection callback.

◆ ber_callback [1/2]

int(* _asn1_ctx_t::ber_callback) (bool imp_tag, tvbuff_t *tvb, int offset, struct _asn1_ctx_t *actx, proto_tree *tree, int hf_index)

BER callback to dissect the contained EMBEDDED PDV value.

Parameters
imp_tagTrue if the tag is implicitly encoded.
tvbBuffer containing the value.
offsetByte offset into tvb.
actxThe enclosing ASN.1 context.
treeProtocol tree to populate.
hf_indexField index for the value item.
Returns
Number of bytes consumed.

◆ ber_callback [2/2]

unsigned(* _asn1_ctx_t::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.

Parameters
imp_tagTrue if the tag is implicitly encoded.
tvbBuffer containing the value.
offsetByte offset into tvb.
actxThe enclosing ASN.1 context.
treeProtocol tree to populate.
hf_indexField index for the value item.
Returns
Number of bytes consumed.

◆ created_item

proto_item* _asn1_ctx_t::created_item

The most recently created protocol tree item, available for post-hoc annotation.

◆ data_value

tvbuff_t* _asn1_ctx_t::data_value

Buffer containing the embedded PDV data value.

◆ data_value_descr_present

bool _asn1_ctx_t::data_value_descr_present

True if the data-value-descriptor field is present.

◆ data_value_descriptor

tvbuff_t* _asn1_ctx_t::data_value_descriptor

Buffer containing the data-value-descriptor string, or NULL.

◆ direct_ref_present

bool _asn1_ctx_t::direct_ref_present

True if the direct-reference OID is present.

◆ direct_reference

const char* _asn1_ctx_t::direct_reference

Direct-reference OID string, or NULL.

◆ [struct]

struct { ... } _asn1_ctx_t::embedded_pdv

Decoding state for ASN.1 EMBEDDED PDV type values.

State for the currently decoded EMBEDDED PDV type instance.

◆ encoding [1/2]

asn1_enc_e _asn1_ctx_t::encoding

Transfer syntax in use for this PDU.

◆ encoding [2/2]

int _asn1_ctx_t::encoding

Encoding of the contained value: 0 = single-ASN1-type, 1 = octet-aligned, 2 = arbitrary.

◆ [struct]

struct { ... } _asn1_ctx_t::external

Decoding state for ASN.1 EXTERNAL type values.

State for the currently decoded EXTERNAL type instance.

◆ hf_index

int _asn1_ctx_t::hf_index

Protocol-tree field index for the EXTERNAL value.

Protocol-tree field index for the EMBEDDED PDV value.

◆ identification

int _asn1_ctx_t::identification

Identification choice in use: 0 = syntaxes, 1 = syntax, 2 = presentation-context-id, 3 = context-negotiation, 4 = transfer-syntax, 5 = fixed.

◆ indirect_ref_present

bool _asn1_ctx_t::indirect_ref_present

True if the indirect-reference integer is present.

◆ indirect_reference

int32_t _asn1_ctx_t::indirect_reference

Indirect-reference presentation-context ID.

◆ octet_aligned

tvbuff_t* _asn1_ctx_t::octet_aligned

Buffer for octet-aligned encoding, or NULL.

◆ [struct] [1/2]

struct { ... } _asn1_ctx_t::per

PER-specific dissection callback.

◆ [struct] [2/2]

struct { ... } _asn1_ctx_t::per

PER-specific dissection callback.

◆ pinfo

packet_info* _asn1_ctx_t::pinfo

Wireshark packet metadata for the current frame.

◆ presentation_context_id

int32_t _asn1_ctx_t::presentation_context_id

Presentation context ID (when identification == 2 or 3).

◆ private_data

void* _asn1_ctx_t::private_data

Opaque pointer reserved for per-dissector private state.

◆ rose_ctx

struct _rose_ctx_t* _asn1_ctx_t::rose_ctx

Optional ROSE (Remote Operations Service Element) context, or NULL.

◆ signature

uint32_t _asn1_ctx_t::signature

Must equal ASN1_CTX_SIGNATURE; guards against stale pointers.

◆ single_asn1_type

tvbuff_t* _asn1_ctx_t::single_asn1_type

Buffer for single-ASN1-type encoding, or NULL.

◆ stack

struct _asn1_stack_frame_t* _asn1_ctx_t::stack

Top of the parameterized type resolution stack.

◆ top_tree

proto_tree* _asn1_ctx_t::top_tree

Root protocol tree for the current PDU.

◆ transfer_syntax

const char* _asn1_ctx_t::transfer_syntax

Transfer syntax OID string (when identification == 0, 4), or NULL.

◆ tree

proto_tree* _asn1_ctx_t::tree

Current working subtree for item insertion.

◆ tree_ctx

void* _asn1_ctx_t::tree_ctx

Opaque per-tree context pointer.

◆ type_cb [1/2]

int(* _asn1_ctx_t::type_cb) (tvbuff_t *tvb, int offset, struct _asn1_ctx_t *actx, proto_tree *tree, int hf_index)

PER callback to dissect the contained EMBEDDED PDV value.

Parameters
tvbBuffer containing the value.
offsetBit offset into tvb.
actxThe enclosing ASN.1 context.
treeProtocol tree to populate.
hf_indexField index for the value item.
Returns
Number of bits consumed.

◆ type_cb [2/2]

unsigned(* _asn1_ctx_t::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.

Parameters
tvbBuffer containing the value.
offsetBit offset into tvb.
actxThe enclosing ASN.1 context.
treeProtocol tree to populate.
hf_indexField index for the value item.
Returns
Number of bits consumed.

◆ [union] [1/2]

union { ... } _asn1_ctx_t::u

Encoding-specific dissection callback.

◆ [union] [2/2]

union { ... } _asn1_ctx_t::u

Encoding-specific dissection callback.

◆ value_ptr

void* _asn1_ctx_t::value_ptr

Generic pointer to the most recently decoded value; type depends on context.


The documentation for this struct was generated from the following file: