diff options
author | Guy Harris <guy@alum.mit.edu> | 2004-03-04 07:07:57 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2004-03-04 07:07:57 +0000 |
commit | 36a9a266f439add59d2504504e58b9654c514a14 (patch) | |
tree | 892f19921beb78588d21fae7a906ef9e830f3753 /packet-ber.h | |
parent | 409e955dbb58264e5bccaaf8bb708b984f811e79 (diff) |
From Tomas Kukosa: add packet-ber.c routines to the plugin API.
svn path=/trunk/; revision=10295
Diffstat (limited to 'packet-ber.h')
-rw-r--r-- | packet-ber.h | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/packet-ber.h b/packet-ber.h index 4f8c40d44c..1768290217 100644 --- a/packet-ber.h +++ b/packet-ber.h @@ -2,7 +2,7 @@ * Helpers for ASN.1/BER dissection * Ronnie Sahlberg (C) 2004 * - * $Id: packet-ber.h,v 1.1 2004/02/20 10:04:10 sahlberg Exp $ + * $Id: packet-ber.h,v 1.2 2004/03/04 07:07:00 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -23,6 +23,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef __PACKET_BER_H__ +#define __PACKET_BER_H__ + typedef int (*ber_callback)(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset); #define BER_CLASS_UNI 0x00 @@ -42,23 +45,23 @@ typedef int (*ber_callback)(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, /* this function dissects the identifier octer of the BER TLV. * We only handle TAGs (and LENGTHs) that fit inside 32 bit integers. */ -int dissect_ber_identifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, guint8 *class, gboolean *pc, guint32 *tag); +extern int dissect_ber_identifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, guint8 *class, gboolean *pc, guint32 *tag); /* this function dissects the identifier octer of the BER TLV. * We only handle (TAGs and) LENGTHs that fit inside 32 bit integers. */ -int dissect_ber_length(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, guint32 *length); +extern int dissect_ber_length(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, guint32 *length); /* func is NULL normally but * if the octet string contains an ber encode struct we provide func as the * dissector for that struct */ -int dissect_ber_octet_string(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, ber_callback func); +extern int dissect_ber_octet_string(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, ber_callback func); -int dissect_ber_integer(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, guint32 *value); +extern int dissect_ber_integer(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, guint32 *value); -int dissect_ber_boolean(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id); +extern int dissect_ber_boolean(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id); #define BER_FLAGS_OPTIONAL 0x00000001 @@ -71,7 +74,7 @@ typedef struct _ber_sequence { /* this function dissects a BER sequence */ -int dissect_ber_sequence(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, ber_sequence *seq, gint hf_id, gint ett_id); +extern int dissect_ber_sequence(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, ber_sequence *seq, gint hf_id, gint ett_id); typedef struct _ber_choice { @@ -83,24 +86,26 @@ typedef struct _ber_choice { /* this function dissects a BER choice */ -int dissect_ber_choice(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, const ber_choice *ch, gint hf_id, gint ett_id); +extern int dissect_ber_choice(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, const ber_choice *ch, gint hf_id, gint ett_id); /* this function dissects a BER GeneralString */ -int dissect_ber_GeneralString(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, char *name_string, int name_len); +extern int dissect_ber_GeneralString(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, char *name_string, int name_len); /* this function dissects a BER sequence of */ -int dissect_ber_sequence_of(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, ber_callback func, gint hf_id, gint ett_id); +extern int dissect_ber_sequence_of(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, ber_callback func, gint hf_id, gint ett_id); -int dissect_ber_generalized_time(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id); +extern int dissect_ber_generalized_time(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id); /* this function dissects a BER BIT-STRING */ -int dissect_ber_bitstring(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, gint hf_id, gint ett_id, unsigned char *bitstring, int bitstring_len, proto_item **it, proto_tree **tr); +extern int dissect_ber_bitstring(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, gint hf_id, gint ett_id, unsigned char *bitstring, int bitstring_len, proto_item **it, proto_tree **tr); extern proto_item *ber_last_created_item; + +#endif /* __PACKET_BER_H__ */ |