aboutsummaryrefslogtreecommitdiffstats
path: root/packet-osi.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>1999-07-29 05:47:07 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>1999-07-29 05:47:07 +0000
commit7bd6c15378e920f89c76cd3beeb7e8bcf6a164e3 (patch)
tree3e8a46fe6f7bb69698edb1187655e445bbfda37c /packet-osi.c
parent6f1d3a3be830da628246f7cea77fe9c491470d17 (diff)
downloadwireshark-7bd6c15378e920f89c76cd3beeb7e8bcf6a164e3.tar.gz
wireshark-7bd6c15378e920f89c76cd3beeb7e8bcf6a164e3.tar.bz2
wireshark-7bd6c15378e920f89c76cd3beeb7e8bcf6a164e3.zip
Made the protocol (but not the fields) use the new proto_tree routine,
allowing users to filter on the existence of these protocols. I also added packet-clip.c to the Nmake makefile. svn path=/trunk/; revision=402
Diffstat (limited to 'packet-osi.c')
-rw-r--r--packet-osi.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/packet-osi.c b/packet-osi.c
index 933811b1ee..79672c6d92 100644
--- a/packet-osi.c
+++ b/packet-osi.c
@@ -1,7 +1,7 @@
/* packet-osi.c
* Routines for ISO/OSI network and transport protocol packet disassembly
*
- * $Id: packet-osi.c,v 1.7 1999/07/07 22:51:49 gram Exp $
+ * $Id: packet-osi.c,v 1.8 1999/07/29 05:47:00 gram Exp $
* Laurent Deniel <deniel@worldnet.fr>
*
* Ethereal - Network traffic analyzer
@@ -45,6 +45,8 @@
#include <glib.h>
#include "packet.h"
+static int proto_osi = 1;
+
/* Network layer protocol identifiers */
#define ISO8473_CLNP 0x81
@@ -245,7 +247,7 @@ static int osi_decode_DR(const u_char *pd, int offset,
src_ref, dst_ref);
if (tree) {
- ti = proto_tree_add_text(tree, offset, li + 1, "ISO COTP");
+ ti = proto_tree_add_item(tree, proto_osi, offset, li + 1, NULL);
cotp_tree = proto_item_add_subtree(ti, ETT_COTP);
proto_tree_add_text(cotp_tree, offset, 1,
"Length indicator: %d", li);
@@ -337,7 +339,7 @@ static int osi_decode_DT(const u_char *pd, int offset,
(fragment)? "(fragment)" : "");
if (tree) {
- ti = proto_tree_add_text(tree, offset, li + 1, "ISO COTP");
+ ti = proto_tree_add_item(tree, proto_osi, offset, li + 1, NULL);
cotp_tree = proto_item_add_subtree(ti, ETT_COTP);
proto_tree_add_text(cotp_tree, offset, 1,
"Length indicator: %d", li);
@@ -471,7 +473,7 @@ static int osi_decode_ED(const u_char *pd, int offset,
col_add_fstr(fd, COL_INFO, "ED TPDU (%d) dst-ref: 0x%04x", tpdu_nr, dst_ref);
if (tree) {
- ti = proto_tree_add_text(tree, offset, li + 1, "ISO COTP");
+ ti = proto_tree_add_item(tree, proto_osi, offset, li + 1, NULL);
cotp_tree = proto_item_add_subtree(ti, ETT_COTP);
proto_tree_add_text(cotp_tree, offset, 1,
"Length indicator: %d", li);
@@ -553,7 +555,7 @@ static int osi_decode_RJ(const u_char *pd, int offset,
col_add_fstr(fd, COL_INFO, "RJ TPDU (%d) dst-ref: 0x%04x", tpdu_nr, dst_ref);
if (tree) {
- ti = proto_tree_add_text(tree, offset, li + 1, "ISO COTP");
+ ti = proto_tree_add_item(tree, proto_osi, offset, li + 1, NULL);
cotp_tree = proto_item_add_subtree(ti, ETT_COTP);
proto_tree_add_text(cotp_tree, offset, 1,
"Length indicator: %d", li);
@@ -641,7 +643,7 @@ static int osi_decode_CC(const u_char *pd, int offset,
dst_ref);
if (tree) {
- ti = proto_tree_add_text(tree, offset, li + 1, "ISO COTP");
+ ti = proto_tree_add_item(tree, proto_osi, offset, li + 1, NULL);
cotp_tree = proto_item_add_subtree(ti, ETT_COTP);
proto_tree_add_text(cotp_tree, offset, 1,
"Length indicator: %d", li);
@@ -913,7 +915,7 @@ static int osi_decode_DC(const u_char *pd, int offset,
dst_ref);
if (tree) {
- ti = proto_tree_add_text(tree, offset, li + 1, "ISO COTP");
+ ti = proto_tree_add_item(tree, proto_osi, offset, li + 1, NULL);
cotp_tree = proto_item_add_subtree(ti, ETT_COTP);
proto_tree_add_text(cotp_tree, offset, 1,
"Length indicator: %d", li);
@@ -966,7 +968,7 @@ static int osi_decode_AK(const u_char *pd, int offset,
tpdu_nr, dst_ref);
if (tree) {
- ti = proto_tree_add_text(tree, offset, li + 1, "ISO COTP");
+ ti = proto_tree_add_item(tree, proto_osi, offset, li + 1, NULL);
cotp_tree = proto_item_add_subtree(ti, ETT_COTP);
proto_tree_add_text(cotp_tree, offset, 1,
"Length indicator: %d", li);
@@ -1072,7 +1074,7 @@ static int osi_decode_AK(const u_char *pd, int offset,
tpdu_nr, dst_ref);
if (tree) {
- ti = proto_tree_add_text(tree, offset, li + 1, "ISO COTP");
+ ti = proto_tree_add_item(tree, proto_osi, offset, li + 1, NULL);
cotp_tree = proto_item_add_subtree(ti, ETT_COTP);
proto_tree_add_text(cotp_tree, offset, 1,
"Length indicator: %d", li);
@@ -1224,7 +1226,7 @@ static int osi_decode_EA(const u_char *pd, int offset,
col_add_fstr(fd, COL_INFO, "EA TPDU (%d) dst-ref: 0x%04x", tpdu_nr, dst_ref);
if (tree) {
- ti = proto_tree_add_text(tree, offset, li + 1, "ISO COTP");
+ ti = proto_tree_add_item(tree, proto_osi, offset, li + 1, NULL);
cotp_tree = proto_item_add_subtree(ti, ETT_COTP);
proto_tree_add_text(cotp_tree, offset, 1,
"Length indicator: %d", li);
@@ -1309,7 +1311,7 @@ static int osi_decode_ER(const u_char *pd, int offset,
col_add_fstr(fd, COL_INFO, "ER TPDU dst-ref: 0x%04x", dst_ref);
if (tree) {
- ti = proto_tree_add_text(tree, offset, li + 1, "ISO COTP");
+ ti = proto_tree_add_item(tree, proto_osi, offset, li + 1, NULL);
cotp_tree = proto_item_add_subtree(ti, ETT_COTP);
proto_tree_add_text(cotp_tree, offset, 1,
"Length indicator: %d", li);
@@ -1603,3 +1605,14 @@ void dissect_osi(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
} /* dissect_osi */
+void
+proto_register_osi(void)
+{
+/* static hf_register_info hf[] = {
+ { &variable,
+ { "Name", "osi.abbreviation", TYPE, VALS_POINTER }},
+ };*/
+
+ proto_osi = proto_register_protocol("ISO COTP", "osi");
+ /* proto_register_field_array(proto_osi, hf, array_length(hf));*/
+}