2004-02-20 10:04:10 +00:00
|
|
|
/* packet-ber.h
|
|
|
|
* Helpers for ASN.1/BER dissection
|
|
|
|
* Ronnie Sahlberg (C) 2004
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2004-02-20 10:04:10 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2004-02-20 10:04:10 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2004-02-20 10:04:10 +00:00
|
|
|
*/
|
|
|
|
|
2004-03-04 07:07:57 +00:00
|
|
|
#ifndef __PACKET_BER_H__
|
|
|
|
#define __PACKET_BER_H__
|
|
|
|
|
2007-01-13 12:59:27 +00:00
|
|
|
#include <epan/proto.h>
|
2005-04-28 09:54:03 +00:00
|
|
|
#include <epan/to_str.h>
|
2007-05-06 22:34:05 +00:00
|
|
|
#include <epan/asn1.h>
|
2013-03-01 23:53:11 +00:00
|
|
|
#include "ws_symbol_export.h"
|
2005-04-28 09:54:03 +00:00
|
|
|
|
2004-05-17 20:03:36 +00:00
|
|
|
#define BER_NOT_DECODED_YET(x) \
|
2004-05-14 23:38:39 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset, 0, "something unknown here [%s]",x); \
|
|
|
|
fprintf(stderr,"Not decoded yet in packet : %d [%s]\n", pinfo->fd->num,x); \
|
2011-09-26 08:25:18 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, "[UNKNOWN BER: %s]", x); \
|
2004-05-14 23:38:39 +00:00
|
|
|
tvb_get_guint8(tvb, 9999);
|
|
|
|
|
2009-12-18 15:18:31 +00:00
|
|
|
/* value for value and size constraints */
|
|
|
|
#ifndef NO_BOUND
|
|
|
|
#define NO_BOUND -1
|
|
|
|
#endif
|
|
|
|
|
2007-05-22 16:17:54 +00:00
|
|
|
typedef int (*ber_callback)(gboolean imp_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index);
|
2007-05-13 20:58:29 +00:00
|
|
|
typedef int (*ber_type_fn)(gboolean, tvbuff_t*, int, asn1_ctx_t *actx, proto_tree*, int);
|
2007-05-22 16:17:54 +00:00
|
|
|
/* To be removed when the transition to the "New" type is complete */
|
|
|
|
|
|
|
|
typedef int (*ber_old_callback)(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx);
|
|
|
|
typedef int (*ber_old_type_fn)(gboolean, tvbuff_t*, int, asn1_ctx_t *actx, proto_tree*, int);
|
2006-06-15 07:46:07 +00:00
|
|
|
|
2004-02-20 10:04:10 +00:00
|
|
|
|
2004-03-25 09:18:03 +00:00
|
|
|
#define BER_CLASS_UNI 0
|
|
|
|
#define BER_CLASS_APP 1
|
|
|
|
#define BER_CLASS_CON 2
|
|
|
|
#define BER_CLASS_PRI 3
|
2004-07-20 10:45:11 +00:00
|
|
|
#define BER_CLASS_ANY 99 /* dont check class nor tag */
|
2004-03-25 09:18:03 +00:00
|
|
|
|
2005-08-18 08:37:31 +00:00
|
|
|
#define BER_UNI_TAG_EOC 0 /* 'end-of-content' */
|
|
|
|
#define BER_UNI_TAG_BOOLEAN 1
|
|
|
|
#define BER_UNI_TAG_INTEGER 2
|
|
|
|
#define BER_UNI_TAG_BITSTRING 3
|
|
|
|
#define BER_UNI_TAG_OCTETSTRING 4
|
|
|
|
#define BER_UNI_TAG_NULL 5
|
|
|
|
#define BER_UNI_TAG_OID 6 /* OBJECT IDENTIFIER */
|
|
|
|
#define BER_UNI_TAG_ObjectDescriptor 7
|
2007-04-20 13:54:56 +00:00
|
|
|
#define BER_UNI_TAG_EXTERNAL 8
|
2005-08-18 08:37:31 +00:00
|
|
|
#define BER_UNI_TAG_REAL 9
|
2004-03-26 00:21:53 +00:00
|
|
|
#define BER_UNI_TAG_ENUMERATED 10
|
|
|
|
#define BER_UNI_TAG_EMBEDDED_PDV 11
|
|
|
|
#define BER_UNI_TAG_UTF8String 12
|
|
|
|
#define BER_UNI_TAG_RELATIVE_OID 13
|
2007-04-20 13:54:56 +00:00
|
|
|
/* UNIVERSAL 14-15
|
|
|
|
* Reserved for future editions of this
|
|
|
|
* Recommendation | International Standard
|
|
|
|
*/
|
2004-03-26 00:21:53 +00:00
|
|
|
#define BER_UNI_TAG_SEQUENCE 16 /* SEQUENCE, SEQUENCE OF */
|
2005-08-18 08:37:31 +00:00
|
|
|
#define BER_UNI_TAG_SET 17 /* SET, SET OF */
|
2007-04-20 13:54:56 +00:00
|
|
|
/* UNIVERSAL 18-22 Character string types */
|
2004-03-25 23:57:10 +00:00
|
|
|
#define BER_UNI_TAG_NumericString 18
|
|
|
|
#define BER_UNI_TAG_PrintableString 19
|
2004-12-13 11:59:48 +00:00
|
|
|
#define BER_UNI_TAG_TeletexString 20 /* TeletextString, T61String */
|
2004-03-25 23:57:10 +00:00
|
|
|
#define BER_UNI_TAG_VideotexString 21
|
|
|
|
#define BER_UNI_TAG_IA5String 22
|
2007-04-20 13:54:56 +00:00
|
|
|
/* UNIVERSAL 23-24 Time types */
|
2005-08-18 08:37:31 +00:00
|
|
|
#define BER_UNI_TAG_UTCTime 23
|
2004-03-26 00:21:53 +00:00
|
|
|
#define BER_UNI_TAG_GeneralizedTime 24
|
2007-04-20 13:54:56 +00:00
|
|
|
/* UNIVERSAL 25-30 Character string types */
|
2004-03-25 23:57:10 +00:00
|
|
|
#define BER_UNI_TAG_GraphicString 25
|
|
|
|
#define BER_UNI_TAG_VisibleString 26 /* VisibleString, ISO64String */
|
2004-03-26 00:21:53 +00:00
|
|
|
#define BER_UNI_TAG_GeneralString 27
|
2004-03-25 23:57:10 +00:00
|
|
|
#define BER_UNI_TAG_UniversalString 28
|
|
|
|
#define BER_UNI_TAG_CHARACTERSTRING 29
|
|
|
|
#define BER_UNI_TAG_BMPString 30
|
2007-04-20 13:54:56 +00:00
|
|
|
/* UNIVERSAL 31- ...
|
|
|
|
* Reserved for addenda to this Recommendation | International Standard
|
|
|
|
*/
|
2004-02-20 10:04:10 +00:00
|
|
|
|
2005-04-22 21:17:13 +00:00
|
|
|
|
2004-02-20 10:04:10 +00:00
|
|
|
/* this function dissects the identifier octer of the BER TLV.
|
|
|
|
* We only handle TAGs (and LENGTHs) that fit inside 32 bit integers.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int get_ber_identifier(tvbuff_t *tvb, int offset, gint8 *ber_class, gboolean *pc, gint32 *tag);
|
|
|
|
WS_DLL_PUBLIC int dissect_ber_identifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint8 *ber_class, gboolean *pc, gint32 *tag);
|
|
|
|
WS_DLL_PUBLIC int dissect_unknown_ber(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree);
|
2004-02-20 10:04:10 +00:00
|
|
|
/* this function dissects the identifier octer of the BER TLV.
|
|
|
|
* We only handle (TAGs and) LENGTHs that fit inside 32 bit integers.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int get_ber_length(tvbuff_t *tvb, int offset, guint32 *length, gboolean *ind);
|
|
|
|
WS_DLL_PUBLIC int dissect_ber_length(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, guint32 *length, gboolean *ind);
|
2004-02-20 10:04:10 +00:00
|
|
|
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int dissect_ber_tagged_type(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, gint8 tag_cls, gint32 tag_tag, gboolean tag_impl, ber_type_fn type);
|
2006-06-15 07:46:07 +00:00
|
|
|
|
2009-12-18 15:18:31 +00:00
|
|
|
extern int dissect_ber_constrained_octet_string(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint32 min_len, gint32 max_len, gint hf_id, tvbuff_t **out_tvb);
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int dissect_ber_octet_string(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, tvbuff_t **out_tvb);
|
2007-05-15 05:49:43 +00:00
|
|
|
extern int dissect_ber_octet_string_wcb(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, ber_callback func);
|
2007-05-22 16:17:54 +00:00
|
|
|
extern int dissect_ber_old_octet_string_wcb(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, ber_old_callback func);
|
2004-02-20 10:04:10 +00:00
|
|
|
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int dissect_ber_integer64(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, gint64 *value);
|
2009-12-18 15:18:31 +00:00
|
|
|
extern int dissect_ber_constrained_integer64(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint64 min_len, gint64 max_len, gint hf_id, gint64 *value);
|
2006-02-28 09:39:53 +00:00
|
|
|
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int dissect_ber_integer(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, guint32 *value);
|
2009-12-18 15:18:31 +00:00
|
|
|
extern int dissect_ber_constrained_integer(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint32 min_len, gint32 max_len, gint hf_id, guint32 *value);
|
2004-02-20 10:04:10 +00:00
|
|
|
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int dissect_ber_null(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id);
|
2004-02-20 10:04:10 +00:00
|
|
|
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int dissect_ber_boolean(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, gboolean *value);
|
2007-06-12 21:29:27 +00:00
|
|
|
extern int dissect_ber_real(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, double *value);
|
2004-02-20 10:04:10 +00:00
|
|
|
|
2007-05-15 05:49:43 +00:00
|
|
|
extern int dissect_ber_external_type(gboolean implicit_tag, proto_tree *parent_tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, gint hf_id, ber_callback func);
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int dissect_ber_EmbeddedPDV_Type(gboolean implicit_tag, proto_tree *parent_tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, gint hf_id, ber_callback func);
|
2004-02-20 10:04:10 +00:00
|
|
|
|
|
|
|
#define BER_FLAGS_OPTIONAL 0x00000001
|
2004-03-25 09:18:03 +00:00
|
|
|
#define BER_FLAGS_IMPLTAG 0x00000002
|
2004-03-26 00:21:53 +00:00
|
|
|
#define BER_FLAGS_NOOWNTAG 0x00000004
|
|
|
|
#define BER_FLAGS_NOTCHKTAG 0x00000008
|
2004-12-13 08:15:34 +00:00
|
|
|
typedef struct _ber_sequence_t {
|
2007-05-22 16:17:54 +00:00
|
|
|
const int *p_id;
|
2011-11-19 09:08:50 +00:00
|
|
|
gint8 ber_class;
|
2004-12-13 08:15:34 +00:00
|
|
|
gint32 tag;
|
2004-02-20 10:04:10 +00:00
|
|
|
guint32 flags;
|
|
|
|
ber_callback func;
|
2004-12-13 08:15:34 +00:00
|
|
|
} ber_sequence_t;
|
2007-05-22 16:17:54 +00:00
|
|
|
/* To be removed when the transition to the "New" type is complete */
|
|
|
|
typedef struct _ber_old_sequence_t {
|
2011-11-19 09:08:50 +00:00
|
|
|
gint8 ber_class;
|
2007-05-22 16:17:54 +00:00
|
|
|
gint32 tag;
|
|
|
|
guint32 flags;
|
|
|
|
ber_old_callback func;
|
|
|
|
} ber_old_sequence_t;
|
|
|
|
/*
|
|
|
|
* This function dissects a BER sequence
|
2004-02-20 10:04:10 +00:00
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int dissect_ber_sequence(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *parent_tree, tvbuff_t *tvb, int offset, const ber_sequence_t *seq, gint hf_id, gint ett_id);
|
|
|
|
WS_DLL_PUBLIC int dissect_ber_set(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *parent_tree, tvbuff_t *tvb, int offset, const ber_sequence_t *seq, gint hf_id, gint ett_id);
|
2004-02-20 10:04:10 +00:00
|
|
|
|
2007-05-22 16:17:54 +00:00
|
|
|
/* To be removed when the transition to the "New" type is complete */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int dissect_ber_old_sequence(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *parent_tree, tvbuff_t *tvb, int offset, const ber_old_sequence_t *seq, gint hf_id, gint ett_id);
|
2007-05-22 16:17:54 +00:00
|
|
|
extern int dissect_ber_old_set(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *parent_tree, tvbuff_t *tvb, int offset, const ber_old_sequence_t *seq, gint hf_id, gint ett_id);
|
|
|
|
|
2004-02-20 10:04:10 +00:00
|
|
|
|
2004-12-13 08:15:34 +00:00
|
|
|
typedef struct _ber_choice_t {
|
2004-03-25 09:18:03 +00:00
|
|
|
guint32 value;
|
2007-05-22 16:17:54 +00:00
|
|
|
const int *p_id;
|
2011-11-19 09:08:50 +00:00
|
|
|
gint8 ber_class;
|
2004-12-13 08:15:34 +00:00
|
|
|
gint32 tag;
|
2004-03-25 09:18:03 +00:00
|
|
|
guint32 flags;
|
2004-02-20 10:04:10 +00:00
|
|
|
ber_callback func;
|
2004-12-13 08:15:34 +00:00
|
|
|
} ber_choice_t;
|
2004-02-20 10:04:10 +00:00
|
|
|
|
2007-05-22 16:17:54 +00:00
|
|
|
typedef struct _ber_old_choice_t {
|
|
|
|
guint32 value;
|
2011-11-19 09:08:50 +00:00
|
|
|
gint8 ber_class;
|
2007-05-22 16:17:54 +00:00
|
|
|
gint32 tag;
|
|
|
|
guint32 flags;
|
|
|
|
ber_old_callback func;
|
|
|
|
} ber_old_choice_t;
|
|
|
|
/*
|
|
|
|
* This function dissects a BER choice
|
2004-02-20 10:04:10 +00:00
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int dissect_ber_choice(asn1_ctx_t *actx, proto_tree *parent_tree, tvbuff_t *tvb, int offset, const ber_choice_t *ch, gint hf_id, gint ett_id, gint *branch_taken);
|
2007-05-22 16:17:54 +00:00
|
|
|
/* To be removed when the transition to the "New" type is complete */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int dissect_ber_old_choice(asn1_ctx_t *actx, proto_tree *parent_tree, tvbuff_t *tvb, int offset, const ber_old_choice_t *ch, gint hf_id, gint ett_id, gint *branch_taken);
|
2004-02-20 10:04:10 +00:00
|
|
|
|
2007-05-22 16:17:54 +00:00
|
|
|
/*
|
|
|
|
* This function dissects a BER strings
|
2004-02-20 10:04:10 +00:00
|
|
|
*/
|
2009-12-18 15:18:31 +00:00
|
|
|
extern int dissect_ber_constrained_restricted_string(gboolean implicit_tag, gint32 type, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint32 min_len, gint32 max_len, gint hf_id, tvbuff_t **out_tvb);
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int dissect_ber_restricted_string(gboolean implicit_tag, gint32 type, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, tvbuff_t **out_tvb);
|
2007-05-15 05:49:43 +00:00
|
|
|
extern int dissect_ber_GeneralString(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, char *name_string, guint name_len);
|
2004-02-20 10:04:10 +00:00
|
|
|
|
|
|
|
|
2004-03-25 09:18:03 +00:00
|
|
|
/* this function dissects a BER Object Identifier
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int dissect_ber_object_identifier(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, tvbuff_t **value_tvb);
|
|
|
|
WS_DLL_PUBLIC int dissect_ber_object_identifier_str(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, const char **value_stringx);
|
2004-03-25 09:18:03 +00:00
|
|
|
|
2004-02-20 10:04:10 +00:00
|
|
|
/* this function dissects a BER sequence of
|
|
|
|
*/
|
2009-12-18 15:18:31 +00:00
|
|
|
extern int dissect_ber_constrained_sequence_of(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *parent_tree, tvbuff_t *tvb, int offset, gint32 min_len, gint32 max_len, const ber_sequence_t *seq, gint hf_id, gint ett_id);
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int dissect_ber_sequence_of(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *parent_tree, tvbuff_t *tvb, int offset, const ber_sequence_t *seq, gint hf_id, gint ett_id);
|
2004-03-25 09:18:03 +00:00
|
|
|
|
2009-12-18 15:18:31 +00:00
|
|
|
extern int dissect_ber_constrained_set_of(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *parent_tree, tvbuff_t *tvb, int offset, gint32 min_len, gint32 max_len, const ber_sequence_t *seq, gint hf_id, gint ett_id);
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int dissect_ber_set_of(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *parent_tree, tvbuff_t *tvb, int offset, const ber_sequence_t *seq, gint hf_id, gint ett_id);
|
2004-02-20 10:04:10 +00:00
|
|
|
|
2007-05-22 16:17:54 +00:00
|
|
|
/* To be removed when the transition to the "New" type is complete */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int dissect_ber_old_sequence_of(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *parent_tree, tvbuff_t *tvb, int offset, const ber_old_sequence_t *seq, gint hf_id, gint ett_id);
|
2007-05-22 16:17:54 +00:00
|
|
|
extern int dissect_ber_old_set_of(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *parent_tree, tvbuff_t *tvb, int offset, const ber_old_sequence_t *seq, gint hf_id, gint ett_id);
|
|
|
|
|
2004-02-20 10:04:10 +00:00
|
|
|
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int dissect_ber_GeneralizedTime(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id);
|
2004-02-20 10:04:10 +00:00
|
|
|
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int dissect_ber_UTCTime(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id);
|
2008-08-01 16:44:06 +00:00
|
|
|
|
2004-03-25 09:18:03 +00:00
|
|
|
typedef struct _asn_namedbit {
|
|
|
|
guint32 bit;
|
|
|
|
int *p_id;
|
|
|
|
gint32 gb0; /* the 1st bit of "bit group", -1 = the 1st bit of current byte */
|
|
|
|
gint32 gb1; /* last bit of "bit group", -1 = last bit of current byte */
|
2005-07-28 07:53:38 +00:00
|
|
|
const gchar *tstr; /* true string */
|
|
|
|
const gchar *fstr; /* false string */
|
2004-03-25 09:18:03 +00:00
|
|
|
} asn_namedbit;
|
2004-02-20 10:04:10 +00:00
|
|
|
/* this function dissects a BER BIT-STRING
|
|
|
|
*/
|
2010-01-05 11:38:33 +00:00
|
|
|
extern int dissect_ber_constrained_bitstring(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *parent_tree, tvbuff_t *tvb, int offset, gint32 min_len, gint32 max_len, const asn_namedbit *named_bits, gint hf_id, gint ett_id, tvbuff_t **out_tvb);
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int dissect_ber_bitstring(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *parent_tree, tvbuff_t *tvb, int offset, const asn_namedbit *named_bits, gint hf_id, gint ett_id, tvbuff_t **out_tvb);
|
2007-05-15 05:49:43 +00:00
|
|
|
extern int dissect_ber_bitstring32(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *parent_tree, tvbuff_t *tvb, int offset, int **bit_fields, gint hf_id, gint ett_id, tvbuff_t **out_tvb);
|
2004-02-20 10:04:10 +00:00
|
|
|
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2005-08-05 13:10:58 +00:00
|
|
|
int call_ber_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2005-07-28 07:53:38 +00:00
|
|
|
void register_ber_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto, const char *name);
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2005-07-28 07:53:38 +00:00
|
|
|
void register_ber_oid_dissector(const char *oid, dissector_t dissector, int proto, const char *name);
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2007-01-13 12:59:27 +00:00
|
|
|
void register_ber_syntax_dissector(const char *oid, int proto, dissector_t dissector);
|
|
|
|
void register_ber_oid_name(const char *oid, const char *name);
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2007-01-13 12:59:27 +00:00
|
|
|
void register_ber_oid_syntax(const char *oid, const char *name, const char *syntax);
|
2004-07-29 09:52:14 +00:00
|
|
|
void dissect_ber_oid_NULL_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
|
2004-07-20 09:11:40 +00:00
|
|
|
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2007-01-13 12:59:27 +00:00
|
|
|
void ber_decode_as_foreach(GHFunc func, gpointer user_data); /* iterate through known syntaxes */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2007-04-23 10:59:26 +00:00
|
|
|
void ber_decode_as(const gchar *syntax); /* decode the current capture as this syntax */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2007-01-13 12:59:27 +00:00
|
|
|
void ber_set_filename(gchar *filename); /* name of current BER-encoded file */
|
|
|
|
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2006-11-04 09:14:54 +00:00
|
|
|
gboolean oid_has_dissector(const char *oid);
|
|
|
|
|
2004-03-26 00:21:53 +00:00
|
|
|
#endif /* __PACKET_BER_H__ */
|
2005-08-18 08:37:31 +00:00
|
|
|
|