aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>2000-05-25 14:55:22 +0000
committergram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>2000-05-25 14:55:22 +0000
commit5eff2fbdea44fae2f4fcf6a422f9c7edc26d6ee9 (patch)
tree854e59abfbdcacfe0fb3eca1f234463271f9024e
parentb7fcf0e5800ee27cd620ef071d338e8df3ac3f6b (diff)
Convert dissect_clip() to use tvbuffs. Very trivial change.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2003 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r--packet-clip.c34
-rw-r--r--packet-clip.h4
-rw-r--r--packet.c4
3 files changed, 23 insertions, 19 deletions
diff --git a/packet-clip.c b/packet-clip.c
index e0ea3f56d2..3249278b73 100644
--- a/packet-clip.c
+++ b/packet-clip.c
@@ -1,7 +1,7 @@
/* packet-clip.c
* Routines for clip packet disassembly
*
- * $Id: packet-clip.c,v 1.7 2000/05/19 05:29:42 guy Exp $
+ * $Id: packet-clip.c,v 1.8 2000/05/25 14:55:22 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -47,20 +47,23 @@ capture_clip( const u_char *pd, packet_counts *ld ) {
}
void
-dissect_clip( const u_char *pd, frame_data *fd, proto_tree *tree ) {
- proto_tree *fh_tree;
- proto_item *ti;
+dissect_clip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+ proto_tree *fh_tree;
+ proto_item *ti;
+ const guint8 *this_pd;
+ int this_offset;
/* load the top pane info. This should be overwritten by
the next protocol in the stack */
- if(check_col(fd, COL_RES_DL_SRC))
- col_add_str(fd, COL_RES_DL_SRC, "N/A" );
- if(check_col(fd, COL_RES_DL_DST))
- col_add_str(fd, COL_RES_DL_DST, "N/A" );
- if(check_col(fd, COL_PROTOCOL))
- col_add_str(fd, COL_PROTOCOL, "CLIP" );
- if(check_col(fd, COL_INFO))
- col_add_str(fd, COL_INFO, "Classical IP frame" );
+ if(check_col(pinfo->fd, COL_RES_DL_SRC))
+ col_add_str(pinfo->fd, COL_RES_DL_SRC, "N/A" );
+ if(check_col(pinfo->fd, COL_RES_DL_DST))
+ col_add_str(pinfo->fd, COL_RES_DL_DST, "N/A" );
+ if(check_col(pinfo->fd, COL_PROTOCOL))
+ col_add_str(pinfo->fd, COL_PROTOCOL, "CLIP" );
+ if(check_col(pinfo->fd, COL_INFO))
+ col_add_str(pinfo->fd, COL_INFO, "Classical IP frame" );
/* populate a tree in the second pane with the status of the link
layer (ie none)
@@ -73,11 +76,12 @@ dissect_clip( const u_char *pd, frame_data *fd, proto_tree *tree ) {
it treats the packet as being raw IP with no link-level
header. */
if(tree) {
- ti = proto_tree_add_text(tree, NullTVB, 0, 0, "Classical IP frame" );
+ ti = proto_tree_add_text(tree, tvb, 0, 0, "Classical IP frame" );
fh_tree = proto_item_add_subtree(ti, ett_clip);
- proto_tree_add_text(fh_tree, NullTVB, 0, 0, "No link information available");
+ proto_tree_add_text(fh_tree, tvb, 0, 0, "No link information available");
}
- dissect_ip(pd, 0, fd, tree);
+ tvb_compat(tvb, &this_pd, &this_offset);
+ dissect_ip(this_pd, this_offset, pinfo->fd, tree);
}
void
diff --git a/packet-clip.h b/packet-clip.h
index 7010eacb35..95e0d8e1f9 100644
--- a/packet-clip.h
+++ b/packet-clip.h
@@ -1,6 +1,6 @@
/* packet-clip.h
*
- * $Id: packet-clip.h,v 1.1 2000/02/15 21:02:06 gram Exp $
+ * $Id: packet-clip.h,v 1.2 2000/05/25 14:55:22 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -23,4 +23,4 @@
*/
void capture_clip(const u_char *, packet_counts *);
-void dissect_clip(const u_char *, frame_data *, proto_tree *);
+void dissect_clip(tvbuff_t *, packet_info *, proto_tree *);
diff --git a/packet.c b/packet.c
index 8ba42cd9ec..8c760519f8 100644
--- a/packet.c
+++ b/packet.c
@@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.90 2000/05/25 08:45:54 gram Exp $
+ * $Id: packet.c,v 1.91 2000/05/25 14:55:22 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -1200,7 +1200,7 @@ dissect_packet(union wtap_pseudo_header *pseudo_header, const u_char *pd,
dissect_raw(tvb, &pi, tree);
break;
case WTAP_ENCAP_LINUX_ATM_CLIP :
- dissect_clip(pd, fd, tree);
+ dissect_clip(tvb, &pi, tree);
break;
case WTAP_ENCAP_ATM_SNIFFER :
dissect_atm(pseudo_header, pd, fd, tree);