aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>2000-03-27 17:53:20 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>2000-03-27 17:53:20 +0000
commit1b25952ad459c5627093eca11853d487fbdcae4a (patch)
tree9371bbe2c77c4c66baa93ef20e334ad6c33e9b1b
parent1d640c1296eeb182ea2d23efb93cd034b07b76ac (diff)
Change dissect_ppp() to accept offset.
Change GRE dissector to call dissect_ppp() instead of dissect_payload_ppp(). svn path=/trunk/; revision=1753
-rw-r--r--packet-ascend.c4
-rw-r--r--packet-gre.c4
-rw-r--r--packet-null.c4
-rw-r--r--packet-ppp.c12
-rw-r--r--packet-ppp.h4
-rw-r--r--packet.c4
6 files changed, 16 insertions, 16 deletions
diff --git a/packet-ascend.c b/packet-ascend.c
index b6330c62f5..079bac0e03 100644
--- a/packet-ascend.c
+++ b/packet-ascend.c
@@ -1,7 +1,7 @@
/* packet-ascend.c
* Routines for decoding Lucent/Ascend packet traces
*
- * $Id: packet-ascend.c,v 1.9 2000/02/15 21:01:58 gram Exp $
+ * $Id: packet-ascend.c,v 1.10 2000/03/27 17:53:18 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -93,7 +93,7 @@ dissect_ascend( const u_char *pd, frame_data *fd, proto_tree *tree ) {
switch (fd->pseudo_header.ascend.type) {
case ASCEND_PFX_WDS_X:
case ASCEND_PFX_WDS_R:
- dissect_ppp(pd, fd, tree);
+ dissect_ppp(pd, 0, fd, tree);
break;
case ASCEND_PFX_WDD:
dissect_eth(pd, 0, fd, tree);
diff --git a/packet-gre.c b/packet-gre.c
index cbd9d7ae8f..dbe20248c6 100644
--- a/packet-gre.c
+++ b/packet-gre.c
@@ -2,7 +2,7 @@
* Routines for the Generic Routing Encapsulation (GRE) protocol
* Brad Robel-Forrest <brad.robel-forrest@watchguard.com>
*
- * $Id: packet-gre.c,v 1.16 2000/03/12 04:47:38 gram Exp $
+ * $Id: packet-gre.c,v 1.17 2000/03/27 17:53:19 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -202,7 +202,7 @@ dissect_gre(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
switch (type) {
case GRE_PPP:
- dissect_payload_ppp(pd, offset, fd, tree);
+ dissect_ppp(pd, offset, fd, tree);
break;
case GRE_IP:
dissect_ip(pd, offset, fd, tree);
diff --git a/packet-null.c b/packet-null.c
index ee7f9088cc..b891777687 100644
--- a/packet-null.c
+++ b/packet-null.c
@@ -1,7 +1,7 @@
/* packet-null.c
* Routines for null packet disassembly
*
- * $Id: packet-null.c,v 1.19 2000/02/15 21:02:44 gram Exp $
+ * $Id: packet-null.c,v 1.20 2000/03/27 17:53:19 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -232,7 +232,7 @@ dissect_null( const u_char *pd, frame_data *fd, proto_tree *tree )
/*
* Hand it to PPP.
*/
- dissect_ppp(pd, fd, tree);
+ dissect_ppp(pd, 0, fd, tree);
} else {
/*
* Treat it as a normal DLT_NULL header.
diff --git a/packet-ppp.c b/packet-ppp.c
index bf81184d52..a8ee8b6912 100644
--- a/packet-ppp.c
+++ b/packet-ppp.c
@@ -1,7 +1,7 @@
/* packet-ppp.c
* Routines for ppp packet disassembly
*
- * $Id: packet-ppp.c,v 1.29 2000/03/12 04:47:48 gram Exp $
+ * $Id: packet-ppp.c,v 1.30 2000/03/27 17:53:19 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -1131,14 +1131,14 @@ dissect_payload_ppp( const u_char *pd, int offset, frame_data *fd, proto_tree *t
}
void
-dissect_ppp( const u_char *pd, frame_data *fd, proto_tree *tree ) {
+dissect_ppp( const u_char *pd, int offset, frame_data *fd, proto_tree *tree ) {
e_ppphdr ph;
proto_item *ti;
proto_tree *fh_tree = NULL;
- ph.ppp_addr = pd[0];
- ph.ppp_ctl = pd[1];
- ph.ppp_prot = pntohs(&pd[2]);
+ ph.ppp_addr = pd[offset+0];
+ ph.ppp_ctl = pd[offset+1];
+ ph.ppp_prot = pntohs(&pd[offset+2]);
/* load the top pane info. This should be overwritten by
the next protocol in the stack */
@@ -1159,7 +1159,7 @@ dissect_ppp( const u_char *pd, frame_data *fd, proto_tree *tree ) {
proto_tree_add_text(fh_tree, 1, 1, "Control: %02x", ph.ppp_ctl);
}
- if (!dissect_ppp_stuff(pd, 2, fd, tree, fh_tree)) {
+ if (!dissect_ppp_stuff(pd, offset+2, fd, tree, fh_tree)) {
if (check_col(fd, COL_PROTOCOL))
col_add_fstr(fd, COL_PROTOCOL, "0x%04x", ph.ppp_prot);
}
diff --git a/packet-ppp.h b/packet-ppp.h
index 08df2bd54b..14e01b8d1a 100644
--- a/packet-ppp.h
+++ b/packet-ppp.h
@@ -1,6 +1,6 @@
/* packet-ppp.h
*
- * $Id: packet-ppp.h,v 1.1 2000/02/15 21:02:53 gram Exp $
+ * $Id: packet-ppp.h,v 1.2 2000/03/27 17:53:20 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -23,5 +23,5 @@
*/
void capture_ppp(const u_char *, packet_counts *);
-void dissect_ppp(const u_char *, frame_data *, proto_tree *);
+void dissect_ppp(const u_char *, int, frame_data *, proto_tree *);
void dissect_payload_ppp(const u_char *, int, frame_data *, proto_tree *);
diff --git a/packet.c b/packet.c
index d40c8adba0..cc8e95065c 100644
--- a/packet.c
+++ b/packet.c
@@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.68 2000/03/26 07:59:47 sharpe Exp $
+ * $Id: packet.c,v 1.69 2000/03/27 17:53:20 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -1129,7 +1129,7 @@ dissect_packet(const u_char *pd, frame_data *fd, proto_tree *tree)
dissect_null(pd, fd, tree);
break;
case WTAP_ENCAP_PPP :
- dissect_ppp(pd, fd, tree);
+ dissect_ppp(pd, 0, fd, tree);
break;
case WTAP_ENCAP_LAPB :
dissect_lapb(pd, fd, tree);