summaryrefslogtreecommitdiff
path: root/plugins/wimax/wimax_tlv.h
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2007-05-25 23:40:42 +0000
committerGerald Combs <gerald@wireshark.org>2007-05-25 23:40:42 +0000
commita491fec183044f6065b8d92a3775f5130049b636 (patch)
tree3f899da6a2bb6dead6dbfa2392764a88ac26faa6 /plugins/wimax/wimax_tlv.h
parent1e7c1bc0369f0c962ed73e8e34fa5ba7fa1a6c3d (diff)
downloadwireshark-a491fec183044f6065b8d92a3775f5130049b636.tar.gz
From Mike Harvey: Support for WiMAX and the WiMAX M2M encapsulation protocol.
Add support for WiMAX and M2M to various makefiles and installer files. Add basic support for M2M to randpkt. svn path=/trunk/; revision=21945
Diffstat (limited to 'plugins/wimax/wimax_tlv.h')
-rw-r--r--plugins/wimax/wimax_tlv.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/plugins/wimax/wimax_tlv.h b/plugins/wimax/wimax_tlv.h
new file mode 100644
index 0000000000..9377c57b1f
--- /dev/null
+++ b/plugins/wimax/wimax_tlv.h
@@ -0,0 +1,63 @@
+/* wimax_tlv.h
+ * WiMax TLV handling function header file
+ *
+ * Copyright (c) 2007 by Intel Corporation.
+ *
+ * Author: Lu Pan <lu.pan@intel.com>
+ *
+ * $Id$
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1999 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 t/he 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.
+ */
+#ifndef _WIMAX_TLV_H_
+#define _WIMAX_TLV_H_
+
+#include <gmodule.h>
+#include <epan/packet.h>
+
+#define WIMAX_TLV_EXTENDED_LENGTH_MASK 0x80
+#define WIMAX_TLV_LENGTH_MASK 0x7F
+
+#define MAX_TLV_LEN 64000
+
+#ifndef UNREFERENCED_PARAMETER
+#define UNREFERENCED_PARAMETER(x) (x) = (x)
+#endif
+
+typedef struct
+{
+ guint8 valid; /* TLV info status: 0=invalid; 1=valid */
+ guint8 type; /* TLV type */
+ guint8 length_type; /* length type: 0=single byte; 1=multiple bytes */
+ guint8 size_of_length; /* size of the TLV length */
+ guint value_offset; /* the offset of TLV value field */
+ gint32 length; /* length of TLV value field */
+} tlv_info_t;
+
+gint init_tlv_info(tlv_info_t *this, tvbuff_t *tvb, gint offset);
+gint valid_tlv_info(tlv_info_t *this);
+gint get_tlv_type(tlv_info_t *this);
+gint get_tlv_length_type(tlv_info_t *this);
+gint get_tlv_size_of_length(tlv_info_t *this);
+gint get_tlv_value_offset(tlv_info_t *this);
+gint32 get_tlv_length(tlv_info_t *this);
+proto_tree *add_tlv_subtree(tlv_info_t *this, gint idx, proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, gboolean little_endian);
+proto_tree *add_protocol_subtree(tlv_info_t *this, gint idx, proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const char *format, ...);
+
+#endif /* WIMAX_TLV_H */