diff options
author | kukosa <kukosa@f5534014-38df-0310-8fa8-9805f1628bb7> | 2006-06-05 06:49:52 +0000 |
---|---|---|
committer | kukosa <kukosa@f5534014-38df-0310-8fa8-9805f1628bb7> | 2006-06-05 06:49:52 +0000 |
commit | 6726a08ee5aa2082ced0f51b1eea2dd4864c7a3c (patch) | |
tree | 6f16b2e9095f9e0c2bb540437053a6ae4487b7be /epan | |
parent | 361e5a33f1796683e95c98a06f15b0dd2bb0b6ac (diff) |
- packet-per.[ch]: Open Type support
- asn2wrs.py: TYPE-IDENTIFIER and ABSTRACT-SYNTAX information object classes support
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18338 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-per.c | 21 | ||||
-rw-r--r-- | epan/dissectors/packet-per.h | 3 |
2 files changed, 24 insertions, 0 deletions
diff --git a/epan/dissectors/packet-per.c b/epan/dissectors/packet-per.c index e9ddfdce94..e695b6b6c1 100644 --- a/epan/dissectors/packet-per.c +++ b/epan/dissectors/packet-per.c @@ -112,6 +112,27 @@ void asn_ctx_init(asn_ctx_t *actx, asn_enc_e encoding, gboolean aligned, packet_ offset=(offset&0xfffffff8)+8; \ } +/* 10 Encoding procedures -------------------------------------------------- */ + +/* 10.2 Open type fields --------------------------------------------------- */ +guint32 +dissect_per_open_type(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, per_type_fn type) +{ + guint32 type_length, end_offset; + + offset = dissect_per_length_determinant(tvb, offset, actx, tree, hf_per_open_type_length, &type_length); + if (actx->aligned) BYTE_ALIGN_OFFSET(offset); + end_offset = offset + type_length * 8; + + if (type) { + type(tvb, offset, actx, tree, hf_index); + } else { + actx->created_item = proto_tree_add_text(tree, tvb, offset>>3, BLEN(offset, end_offset), "Unknown Open Type"); + } + + return end_offset; +} + /* 10.9 General rules for encoding a length determinant -------------------- */ guint32 dissect_per_length_determinant(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx _U_, proto_tree *tree, int hf_index, guint32 *length) diff --git a/epan/dissectors/packet-per.h b/epan/dissectors/packet-per.h index bc3fe2a463..ea1c953685 100644 --- a/epan/dissectors/packet-per.h +++ b/epan/dissectors/packet-per.h @@ -56,6 +56,7 @@ if (check_col(actx->pinfo->cinfo, COL_INFO)){ \ tvb_get_guint8(tvb, 9999); typedef int (*per_callback)(tvbuff_t *, int, asn_ctx_t *, proto_tree *); +typedef int (*per_type_fn)(tvbuff_t*, int, asn_ctx_t*, proto_tree*, int); /* in all functions here, offset is guint32 and is byteposition<<3 + bitposition @@ -133,4 +134,6 @@ extern guint32 dissect_per_restricted_character_string(tvbuff_t *tvb, guint32 of extern guint32 dissect_per_enumerated(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, guint32 root_num, guint32 *value, gboolean has_extension, guint32 ext_num, guint32 *value_map); +extern guint32 dissect_per_open_type(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, per_type_fn type); + #endif /* __PACKET_PER_H__ */ |