aboutsummaryrefslogtreecommitdiffstats
path: root/packet-per.h
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2003-07-12 22:35:21 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2003-07-12 22:35:21 +0000
commit6ffb0280ee4da969b26107a53eb6c4f7d26cc0ea (patch)
tree8bde3b485639272bf48c25a3f96983ab0ca28f0e /packet-per.h
parentaa9cd7b7d7255ea4f358873a7fe52c1e8a99a8d4 (diff)
Break out the PER functions from the alternative h245 dissector
and put them in their own file. I had to put them im packet-per.c instead of asn1-per.c since othervise i couldnt get it to invoke the register routine from register.c the per dissector is compiled into ethereal by default, but there are no callers in ethereal until the h245 dissector is added. someone that knows the registry stuff better might consider renaming it to asn1-per.c instead of packet-per.c svn path=/trunk/; revision=8017
Diffstat (limited to 'packet-per.h')
-rw-r--r--packet-per.h86
1 files changed, 86 insertions, 0 deletions
diff --git a/packet-per.h b/packet-per.h
new file mode 100644
index 0000000000..b730078889
--- /dev/null
+++ b/packet-per.h
@@ -0,0 +1,86 @@
+/* packet-per.h
+ * Routines for dissection of ASN.1 Aligned PER
+ * 2003 Ronnie Sahlberg
+ *
+ * $Id: packet-per.h,v 1.1 2003/07/12 22:35:21 sahlberg Exp $
+ *
+ * Ethereal - Network traffic analyzer
+ * By Gerald Combs <gerald@ethereal.com>
+ * 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
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#define NOT_DECODED_YET(x) \
+proto_tree_add_text(tree, tvb, offset, 0, "something unknown here"); \
+fprintf(stderr,"Not decoded yet in packet : %d [%s]\n", pinfo->fd->num,x);
+
+/* in all functions here, offset is guint32 and is
+ byteposition<<3 + bitposition
+*/
+
+/* values for extensions */
+#define NO_EXTENSIONS 0
+#define EXTENSION_ROOT 1
+#define NOT_EXTENSION_ROOT 2
+
+/* value for optional */
+#define NOT_OPTIONAL 0
+#define OPTIONAL 1
+
+typedef struct _per_choice_t {
+ int value;
+ char *name;
+ int extension;
+ int (*func)(tvbuff_t *, int, packet_info *, proto_tree *);
+} per_choice_t;
+
+typedef struct _per_sequence_t {
+ char *name;
+ int extension;
+ int optional;
+ int (*func)(tvbuff_t *, int, packet_info *, proto_tree *);
+} per_sequence_t;
+
+
+guint32 dissect_per_length_determinant(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, guint32 *length);
+
+guint32 dissect_per_normally_small_nonnegative_whole_number(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, guint32 *length);
+
+guint32 dissect_per_GeneralString(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index);
+
+guint32 dissect_per_sequence_of(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *parent_tree, int hf_index, gint ett_index, int (*func)(tvbuff_t *, int , packet_info *, proto_tree *));
+
+guint32 dissect_per_IA5String(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len);
+
+guint32 dissect_per_constrained_sequence_of(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *parent_tree, int hf_index, gint ett_index, int (*func)(tvbuff_t *, int , packet_info *, proto_tree *), int min_len, int max_len);
+
+guint32 dissect_per_constrained_set_of(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *parent_tree, int hf_index, gint ett_index, int (*func)(tvbuff_t *, int , packet_info *, proto_tree *), int min_len, int max_len);
+
+guint32 dissect_per_set_of(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *parent_tree, int hf_index, gint ett_index, int (*func)(tvbuff_t *, int , packet_info *, proto_tree *));
+
+guint32 dissect_per_object_identifier(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index);
+
+guint32 dissect_per_boolean(tvbuff_t *tvb, guint32 offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index, gboolean *bool, proto_item **item);
+
+guint32 dissect_per_integer(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, gint32 *value, proto_item **item);
+
+guint32 dissect_per_constrained_integer(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, guint32 min, guint32 max, guint32 *value, proto_item **item);
+
+guint32 dissect_per_choice(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, gint ett_index, per_choice_t *choice, char *name, guint32 *value);
+
+guint32 dissect_per_sequence(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *parent_tree, int hf_index, gint ett_index, per_sequence_t *sequence);
+
+guint32 dissect_per_octet_string(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len);