1998-09-16 02:39:15 +00:00
|
|
|
/* packet-ppp.c
|
|
|
|
* Routines for ppp packet disassembly
|
Add new routines:
tvb_get_string() - takes a tvbuff, an offset, and a length as
arguments, allocates a buffer big enough to hold a string with
the specified number of bytes plus an added null terminator
(i.e., length+1), copies the specified number of bytes from the
tvbuff, at the specified offset, to that buffer and puts in a
null terminator, and returns a pointer to that buffer (or throws
an exception before allocating the buffer if that many bytes
aren't available in the tvbuff);
tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to
a "gint" as arguments, gets the size of the null-terminated
string starting at the specified offset in the tvbuff (throwing
an exception if the null terminator isn't found), allocates a
buffer big enough to hold that string, copies the string to that
buffer, and returns a pointer to that buffer and stores the
length of the string (including the terminating null) in the
variable pointed to by the "gint" pointer.
Replace many pieces of code allocating a buffer and copying a string
with calls to "tvb_get_string()" (for one thing, "tvb_get_string()"
doesn't require you to remember that the argument to
"tvb_get_nstringz0()" is the size of the buffer into which you're
copying the string, which might be the length of the string to be copied
*plus 1*).
Don't use fixed-length buffers for null-terminated strings (even if the
code that generates those packets has a #define to limit the length of
the string). Use "tvb_get_stringz()", instead.
In some cases where a value is fetched but is only used to pass an
argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()"
instead.
svn path=/trunk/; revision=7859
2003-06-12 08:33:32 +00:00
|
|
|
* RFC 1661, RFC 1662
|
1998-09-16 02:39:15 +00:00
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
1998-09-16 03:22:19 +00:00
|
|
|
*
|
1998-09-16 02:39:15 +00:00
|
|
|
* Ethereal - Network traffic analyzer
|
2001-04-23 18:19:03 +00:00
|
|
|
* By Gerald Combs <gerald@ethereal.com>
|
1998-09-16 02:39:15 +00:00
|
|
|
*
|
|
|
|
* This file created and by Mike Hall <mlh@io.com>
|
|
|
|
* Copyright 1998
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1998-09-16 02:39:15 +00:00
|
|
|
* 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.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1998-09-16 02:39:15 +00:00
|
|
|
* 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.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1998-09-16 02:39:15 +00:00
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2002-04-14 23:04:04 +00:00
|
|
|
#include <string.h>
|
1999-03-23 03:14:46 +00:00
|
|
|
#include <glib.h>
|
2004-09-27 22:55:15 +00:00
|
|
|
#include <epan/prefs.h>
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/packet.h>
|
2000-05-19 05:29:44 +00:00
|
|
|
#include "packet-ppp.h"
|
2000-04-16 21:37:07 +00:00
|
|
|
#include "ppptypes.h"
|
2001-01-10 09:07:35 +00:00
|
|
|
#include "etypes.h"
|
2003-07-11 09:30:49 +00:00
|
|
|
#include "ip_opts.h"
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/atalk-utils.h>
|
Add a new Wiretap encapsulation type for Cisco HDLC. Map the NetBSD
DLT_HDLC to it.
Make a separate dissector for Cisco HDLC, and add a dissector for Cisco
SLARP. Have the PPP dissector call the Cisco HDLC dissector if the
address field is the Cisco HDLC unicast or multicast address. Use the
Cisco HDLC dissector for the Cisco HDLC Wiretap encapsulation type.
Add a new dissector table "chdlctype", for Cisco HDLC packet types
(they're *almost* the same as Ethernet types, but 0x8035 is SLARP, not
Reverse ARP, and 0x2000 is the Cisco Discovery protocol, for example),
replacing "fr.chdlc".
Have a "chdlctype()" routine, similar to "ethertype()", used both by the
Cisco HDLC and Frame Relay dissectors. Have a "chdlc_vals[]"
"value_string" table for Cisco HDLC types and protocol names. Split the
packet type field in the Frame Relay dissector into separate SNAP and
Cisco HDLC fields, and give them the Ethernet type and Cisco HDLC type
"value_string" tables, respectively.
svn path=/trunk/; revision=3133
2001-03-15 09:11:03 +00:00
|
|
|
#include "packet-chdlc.h"
|
1999-08-28 08:31:28 +00:00
|
|
|
#include "packet-ip.h"
|
2000-02-15 21:06:58 +00:00
|
|
|
#include "packet-ipx.h"
|
|
|
|
#include "packet-vines.h"
|
2001-01-10 09:07:35 +00:00
|
|
|
#include "nlpid.h"
|
2004-09-28 00:06:32 +00:00
|
|
|
#include <epan/crc16.h>
|
|
|
|
#include <epan/crc32.h>
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2001-06-15 20:35:08 +00:00
|
|
|
#define ppp_min(a, b) ((a<b) ? a : b)
|
|
|
|
|
1999-07-29 05:47:07 +00:00
|
|
|
static int proto_ppp = -1;
|
2001-12-20 06:22:24 +00:00
|
|
|
static int hf_ppp_address = -1;
|
|
|
|
static int hf_ppp_control = -1;
|
|
|
|
static int hf_ppp_protocol = -1;
|
1999-11-16 11:44:20 +00:00
|
|
|
|
|
|
|
static gint ett_ppp = -1;
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
|
2004-12-13 10:10:51 +00:00
|
|
|
static int proto_ppp_hdlc = -1;
|
|
|
|
|
|
|
|
static gint ett_ppp_hdlc_data = -1;
|
|
|
|
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
static int proto_lcp = -1;
|
|
|
|
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint ett_lcp = -1;
|
|
|
|
static gint ett_lcp_options = -1;
|
|
|
|
static gint ett_lcp_authprot_opt = -1;
|
|
|
|
static gint ett_lcp_qualprot_opt = -1;
|
|
|
|
static gint ett_lcp_fcs_alternatives_opt = -1;
|
|
|
|
static gint ett_lcp_numbered_mode_opt = -1;
|
|
|
|
static gint ett_lcp_callback_opt = -1;
|
|
|
|
static gint ett_lcp_multilink_ep_disc_opt = -1;
|
|
|
|
static gint ett_lcp_internationalization_opt = -1;
|
|
|
|
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
static int proto_ipcp = -1;
|
|
|
|
|
|
|
|
static gint ett_ipcp = -1;
|
|
|
|
static gint ett_ipcp_options = -1;
|
|
|
|
static gint ett_ipcp_ipaddrs_opt = -1;
|
2004-11-22 02:12:43 +00:00
|
|
|
static gint ett_ipcp_compress_opt = -1;
|
2004-11-12 10:17:13 +00:00
|
|
|
static gint ett_ipcp_iphc_disableprot_opt = -1;
|
2000-04-16 21:37:07 +00:00
|
|
|
|
2004-04-29 20:21:28 +00:00
|
|
|
static int proto_osicp = -1;
|
|
|
|
|
|
|
|
static gint ett_osicp = -1;
|
|
|
|
static gint ett_osicp_options = -1;
|
|
|
|
static gint ett_osicp_align_npdu_opt = -1;
|
|
|
|
|
2001-10-29 19:48:45 +00:00
|
|
|
static int proto_ccp = -1;
|
|
|
|
|
|
|
|
static gint ett_ccp = -1;
|
|
|
|
static gint ett_ccp_options = -1;
|
|
|
|
static gint ett_ccp_stac_opt = -1;
|
|
|
|
static gint ett_ccp_mppc_opt = -1;
|
2002-01-11 21:37:10 +00:00
|
|
|
static gint ett_ccp_bsdcomp_opt = -1;
|
2001-10-29 19:48:45 +00:00
|
|
|
static gint ett_ccp_lzsdcp_opt = -1;
|
2002-01-11 21:37:10 +00:00
|
|
|
static gint ett_ccp_mvrca_opt = -1;
|
|
|
|
static gint ett_ccp_deflate_opt = -1;
|
2001-10-29 19:48:45 +00:00
|
|
|
|
2001-11-04 04:50:12 +00:00
|
|
|
static int proto_cbcp = -1;
|
|
|
|
|
|
|
|
static gint ett_cbcp = -1;
|
|
|
|
static gint ett_cbcp_options = -1;
|
|
|
|
static gint ett_cbcp_callback_opt = -1;
|
2002-04-01 00:51:43 +00:00
|
|
|
static gint ett_cbcp_callback_opt_addr = -1;
|
2001-11-04 04:50:12 +00:00
|
|
|
|
2001-12-08 01:03:19 +00:00
|
|
|
static int proto_bacp = -1;
|
|
|
|
|
|
|
|
static gint ett_bacp = -1;
|
|
|
|
static gint ett_bacp_options = -1;
|
|
|
|
static gint ett_bacp_favored_peer_opt = -1;
|
|
|
|
|
|
|
|
static int proto_bap = -1;
|
|
|
|
|
|
|
|
static gint ett_bap = -1;
|
|
|
|
static gint ett_bap_options = -1;
|
|
|
|
static gint ett_bap_link_type_opt = -1;
|
|
|
|
static gint ett_bap_phone_delta_opt = -1;
|
2002-04-01 00:51:43 +00:00
|
|
|
static gint ett_bap_phone_delta_subopt = -1;
|
2001-12-08 01:03:19 +00:00
|
|
|
static gint ett_bap_call_status_opt = -1;
|
|
|
|
|
2001-10-29 19:48:45 +00:00
|
|
|
static int proto_comp_data = -1;
|
|
|
|
|
|
|
|
static gint ett_comp_data = -1;
|
|
|
|
|
2002-01-03 20:30:33 +00:00
|
|
|
static int proto_pppmuxcp = -1;
|
|
|
|
|
|
|
|
static gint ett_pppmuxcp = -1;
|
|
|
|
static gint ett_pppmuxcp_options = -1;
|
|
|
|
|
|
|
|
static int proto_pppmux = -1;
|
|
|
|
|
|
|
|
static gint ett_pppmux = -1;
|
|
|
|
static gint ett_pppmux_subframe = -1;
|
|
|
|
static gint ett_pppmux_subframe_hdr = -1;
|
|
|
|
static gint ett_pppmux_subframe_flags = -1;
|
|
|
|
static gint ett_pppmux_subframe_info = -1;
|
|
|
|
|
1999-09-11 04:19:26 +00:00
|
|
|
static int proto_mp = -1;
|
1999-09-11 22:40:30 +00:00
|
|
|
static int hf_mp_frag_first = -1;
|
|
|
|
static int hf_mp_frag_last = -1;
|
|
|
|
static int hf_mp_sequence_num = -1;
|
1999-07-29 05:47:07 +00:00
|
|
|
|
1999-11-16 11:44:20 +00:00
|
|
|
static int ett_mp = -1;
|
|
|
|
static int ett_mp_flags = -1;
|
|
|
|
|
2002-08-18 15:30:38 +00:00
|
|
|
static int proto_mplscp = -1;
|
|
|
|
static gint ett_mplscp = -1;
|
|
|
|
static gint ett_mplscp_options = -1;
|
|
|
|
|
|
|
|
static int proto_cdpcp = -1;
|
|
|
|
static gint ett_cdpcp = -1;
|
|
|
|
static gint ett_cdpcp_options = -1;
|
|
|
|
|
2001-06-15 20:35:08 +00:00
|
|
|
static int proto_pap = -1; /* PAP vars */
|
|
|
|
static gint ett_pap = -1;
|
|
|
|
static gint ett_pap_data = -1;
|
|
|
|
static gint ett_pap_peer_id = -1;
|
|
|
|
static gint ett_pap_password = -1;
|
|
|
|
static gint ett_pap_message = -1;
|
|
|
|
|
2001-09-30 13:30:51 +00:00
|
|
|
static int proto_chap = -1; /* CHAP vars */
|
|
|
|
static gint ett_chap = -1;
|
|
|
|
static gint ett_chap_data = -1;
|
|
|
|
static gint ett_chap_value = -1;
|
|
|
|
static gint ett_chap_name = -1;
|
|
|
|
static gint ett_chap_message = -1;
|
|
|
|
|
2002-10-14 23:23:20 +00:00
|
|
|
static int proto_ipv6cp = -1; /* IPv6CP vars */
|
|
|
|
|
|
|
|
static gint ett_ipv6cp = -1;
|
|
|
|
static gint ett_ipv6cp_options = -1;
|
2003-02-07 20:09:33 +00:00
|
|
|
static gint ett_ipv6cp_if_id_opt = -1;
|
2004-11-22 02:12:43 +00:00
|
|
|
static gint ett_ipv6cp_compress_opt = -1;
|
2002-10-14 23:23:20 +00:00
|
|
|
|
2003-04-29 17:56:49 +00:00
|
|
|
static dissector_table_t ppp_subdissector_table;
|
Add a new Wiretap encapsulation type for Cisco HDLC. Map the NetBSD
DLT_HDLC to it.
Make a separate dissector for Cisco HDLC, and add a dissector for Cisco
SLARP. Have the PPP dissector call the Cisco HDLC dissector if the
address field is the Cisco HDLC unicast or multicast address. Use the
Cisco HDLC dissector for the Cisco HDLC Wiretap encapsulation type.
Add a new dissector table "chdlctype", for Cisco HDLC packet types
(they're *almost* the same as Ethernet types, but 0x8035 is SLARP, not
Reverse ARP, and 0x2000 is the Cisco Discovery protocol, for example),
replacing "fr.chdlc".
Have a "chdlctype()" routine, similar to "ethertype()", used both by the
Cisco HDLC and Frame Relay dissectors. Have a "chdlc_vals[]"
"value_string" table for Cisco HDLC types and protocol names. Split the
packet type field in the Frame Relay dissector into separate SNAP and
Cisco HDLC fields, and give them the Ethernet type and Cisco HDLC type
"value_string" tables, respectively.
svn path=/trunk/; revision=3133
2001-03-15 09:11:03 +00:00
|
|
|
static dissector_handle_t chdlc_handle;
|
2001-11-25 22:51:14 +00:00
|
|
|
static dissector_handle_t data_handle;
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
|
2000-12-14 08:20:31 +00:00
|
|
|
/* options */
|
|
|
|
static gint ppp_fcs_decode = 0; /* 0 = No FCS, 1 = 16 bit FCS, 2 = 32 bit FCS */
|
|
|
|
#define NO_FCS 0
|
|
|
|
#define FCS_16 1
|
|
|
|
#define FCS_32 2
|
2003-08-26 05:52:53 +00:00
|
|
|
|
|
|
|
const enum_val_t fcs_options[] = {
|
2004-05-24 02:25:21 +00:00
|
|
|
{"none", "None", NO_FCS},
|
|
|
|
{"16-bit", "16-Bit", FCS_16},
|
|
|
|
{"32-bit", "32-Bit", FCS_32},
|
|
|
|
{NULL, NULL, -1}
|
2003-08-26 05:52:53 +00:00
|
|
|
};
|
|
|
|
|
2001-12-19 21:14:49 +00:00
|
|
|
gboolean ppp_vj_decomp = TRUE; /* Default to VJ header decompression */
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-01-03 20:30:33 +00:00
|
|
|
/*
|
|
|
|
* For Default Protocol ID negotiated with PPPMuxCP. We need to
|
|
|
|
* this ID so that if the first subframe doesn't have protocol
|
|
|
|
* ID, we can use it
|
|
|
|
*/
|
|
|
|
|
|
|
|
static guint pppmux_def_prot_id = 0;
|
2000-12-14 08:20:31 +00:00
|
|
|
|
2001-03-29 09:18:34 +00:00
|
|
|
/* PPP definitions */
|
1999-03-23 03:14:46 +00:00
|
|
|
|
Instead of tweaking a "Protocol configuration options" extension header
item to look more-or-less like a PPP packet, just dissect it in place
and hand off to the appropriate subdissector using the PPP dissector's
handoff table (which we export, along with its value_string table for
protocol IDs, which we use to report the protocol ID symbolically).
This means there's no point in having a configurable option to control
whether to do that tweaking; make it an obsolete option.
Bring "col_get_writable()" back from the dead, and have the GTP
dissector save the current "writable" flag for columns, mark the columns
non-writable before calling the subdissector for the PPP configuration
protocol, and restore the state of the writable flag, rather than
putting the columns back after the PPP configuration protocol's
dissector is done.
Fix some more typos in comments.
Don't register the IP dissector in the "ppp.protocol" table in the GTP
dissector's handoff registration routine - it's already being done in
the IP dissector's handoff routine.
Fix the name for CHAP to match what RFC 1994 calls it (if the name
changed, it should be changed in all places, but, at least according to
this message, a while ago, from Bob Sutterfield, "since the RFC defines
the protocol, the RFC defines the name":
http://mail-index.netbsd.org/netbsd-help/1996/05/16/0011.html
and the RFC defines the name as "PPP Challenge Handshake Authentication
Protocol (CHAP)").
svn path=/trunk/; revision=6617
2002-11-11 19:23:14 +00:00
|
|
|
/*
|
|
|
|
* Used by the GTP dissector as well.
|
|
|
|
*/
|
|
|
|
const value_string ppp_vals[] = {
|
2002-08-18 15:30:38 +00:00
|
|
|
{PPP_PADDING, "Padding Protocol" },
|
|
|
|
{PPP_ROHC_SCID, "ROHC small-CID" },
|
|
|
|
{PPP_ROHC_LCID, "ROHC large-CID" },
|
1999-06-11 15:30:55 +00:00
|
|
|
{PPP_IP, "IP" },
|
2001-04-16 10:04:33 +00:00
|
|
|
{PPP_OSI, "OSI" },
|
2002-08-18 15:30:38 +00:00
|
|
|
{PPP_DEC4, "DECnet Phase IV" },
|
1999-06-11 15:30:55 +00:00
|
|
|
{PPP_AT, "Appletalk" },
|
|
|
|
{PPP_IPX, "Netware IPX/SPX"},
|
|
|
|
{PPP_VJC_COMP, "VJ compressed TCP"},
|
2001-01-14 08:25:14 +00:00
|
|
|
{PPP_VJC_UNCOMP,"VJ uncompressed TCP"},
|
|
|
|
{PPP_BPDU, "Bridging PDU"},
|
2002-08-18 15:30:38 +00:00
|
|
|
{PPP_ST, "Stream Protocol (ST-II)" },
|
1999-06-11 15:30:55 +00:00
|
|
|
{PPP_VINES, "Vines" },
|
2002-08-18 15:30:38 +00:00
|
|
|
{PPP_AT_EDDP, "AppleTalk EDDP" },
|
|
|
|
{PPP_AT_SB, "AppleTalk SmartBuffered" },
|
|
|
|
{PPP_MP, "Multilink"},
|
|
|
|
{PPP_NB, "NETBIOS Framing" },
|
|
|
|
{PPP_CISCO, "Cisco Systems" },
|
|
|
|
{PPP_ASCOM, "Ascom Timeplex" },
|
|
|
|
{PPP_LBLB, "Fujitsu Link Backup and Load Balancing" },
|
|
|
|
{PPP_RL, "DCA Remote Lan" },
|
|
|
|
{PPP_SDTP, "Serial Data Transport Protocol" },
|
|
|
|
{PPP_LLC, "SNA over LLC" },
|
|
|
|
{PPP_SNA, "SNA" },
|
|
|
|
{PPP_IPV6HC, "IPv6 Header Compression " },
|
|
|
|
{PPP_KNX, "KNX Bridging Data" },
|
|
|
|
{PPP_ENCRYPT, "Encryption" },
|
|
|
|
{PPP_ILE, "Individual Link Encryption" },
|
1999-06-11 15:30:55 +00:00
|
|
|
{PPP_IPV6, "IPv6" },
|
2002-01-03 20:30:33 +00:00
|
|
|
{PPP_MUX, "PPP Multiplexing"},
|
2002-08-18 15:30:38 +00:00
|
|
|
{PPP_RTP_FH, "RTP IPHC Full Header" },
|
|
|
|
{PPP_RTP_CTCP, "RTP IPHC Compressed TCP" },
|
|
|
|
{PPP_RTP_CNTCP, "RTP IPHC Compressed Non TCP" },
|
|
|
|
{PPP_RTP_CUDP8, "RTP IPHC Compressed UDP 8" },
|
|
|
|
{PPP_RTP_CRTP8, "RTP IPHC Compressed RTP 8" },
|
|
|
|
{PPP_STAMPEDE, "Stampede Bridging" },
|
|
|
|
{PPP_MPPLUS, "MP+ Protocol" },
|
|
|
|
{PPP_NTCITS_IPI,"NTCITS IPI" },
|
|
|
|
{PPP_ML_SLCOMP, "single link compression in multilink" },
|
1999-08-25 06:52:04 +00:00
|
|
|
{PPP_COMP, "compressed packet" },
|
2002-08-18 15:30:38 +00:00
|
|
|
{PPP_STP_HELLO, "802.1d Hello Packet" },
|
|
|
|
{PPP_IBM_SR, "IBM Source Routing BPDU" },
|
2001-01-14 08:25:14 +00:00
|
|
|
{PPP_DEC_LB, "DEC LANBridge100 Spanning Tree"},
|
2002-08-18 15:30:38 +00:00
|
|
|
{PPP_CDP, "Cisco Discovery Protocol" },
|
|
|
|
{PPP_NETCS, "Netcs Twin Routing" },
|
|
|
|
{PPP_STP, "Scheduled Transfer Protocol" },
|
|
|
|
{PPP_EDP, "Extreme Discovery Protocol" },
|
|
|
|
{PPP_OSCP, "Optical Supervisory Channel Protocol" },
|
|
|
|
{PPP_OSCP2, "Optical Supervisory Channel Protocol" },
|
|
|
|
{PPP_LUXCOM, "Luxcom" },
|
|
|
|
{PPP_SIGMA, "Sigma Network Systems" },
|
|
|
|
{PPP_ACSP, "Apple Client Server Protocol" },
|
2001-01-14 08:25:14 +00:00
|
|
|
{PPP_MPLS_UNI, "MPLS Unicast"},
|
|
|
|
{PPP_MPLS_MULTI, "MPLS Multicast"},
|
2002-08-18 15:30:38 +00:00
|
|
|
{PPP_P12844, "IEEE p1284.4 standard - data packets" },
|
|
|
|
{PPP_ETSI, "ETSI TETRA Networks Procotol Type 1" },
|
|
|
|
{PPP_MFTP, "Multichannel Flow Treatment Protocol" },
|
|
|
|
{PPP_RTP_CTCPND,"RTP IPHC Compressed TCP No Delta" },
|
|
|
|
{PPP_RTP_CS, "RTP IPHC Context State" },
|
|
|
|
{PPP_RTP_CUDP16,"RTP IPHC Compressed UDP 16" },
|
|
|
|
{PPP_RTP_CRDP16,"RTP IPHC Compressed RTP 16" },
|
|
|
|
{PPP_CCCP, "Cray Communications Control Protocol" },
|
|
|
|
{PPP_CDPD_MNRP, "CDPD Mobile Network Registration Protocol" },
|
|
|
|
{PPP_EXPANDAP, "Expand accelarator protocol" },
|
|
|
|
{PPP_ODSICP, "ODSICP NCP" },
|
|
|
|
{PPP_DOCSIS, "DOCSIS DLL" },
|
|
|
|
{PPP_LZS, "Stacker LZS" },
|
|
|
|
{PPP_REFTEK, "RefTek Protocol" },
|
|
|
|
{PPP_FC, "Fibre Channel" },
|
|
|
|
{PPP_EMIT, "EMIT Protocols" },
|
1999-08-25 06:52:04 +00:00
|
|
|
{PPP_IPCP, "IP Control Protocol" },
|
2001-04-16 10:04:33 +00:00
|
|
|
{PPP_OSICP, "OSI Control Protocol" },
|
2002-08-18 15:30:38 +00:00
|
|
|
{PPP_XNSIDPCP, "Xerox NS IDP Control Protocol" },
|
|
|
|
{PPP_DECNETCP, "DECnet Phase IV Control Protocol" },
|
1999-08-25 06:52:04 +00:00
|
|
|
{PPP_ATCP, "AppleTalk Control Protocol" },
|
|
|
|
{PPP_IPXCP, "IPX Control Protocol" },
|
2002-08-18 15:30:38 +00:00
|
|
|
{PPP_BRIDGENCP, "Bridging NCP" },
|
|
|
|
{PPP_SPCP, "Stream Protocol Control Protocol" },
|
|
|
|
{PPP_BVCP, "Banyan Vines Control Protocol" },
|
|
|
|
{PPP_MLCP, "Multi-Link Control Protocol" },
|
|
|
|
{PPP_NBCP, "NETBIOS Framing Control Protocol" },
|
|
|
|
{PPP_CISCOCP, "Cisco Systems Control Protocol" },
|
|
|
|
{PPP_ASCOMCP, "Ascom Timeplex" },
|
|
|
|
{PPP_LBLBCP, "Fujitsu LBLB Control Protocol" },
|
|
|
|
{PPP_RLNCP, "DCA Remote Lan Network Control Protocol" },
|
|
|
|
{PPP_SDCP, "Serial Data Control Protocol" },
|
|
|
|
{PPP_LLCCP, "SNA over LLC Control Protocol" },
|
|
|
|
{PPP_SNACP, "SNA Control Protocol" },
|
|
|
|
{PPP_KNXCP, "KNX Bridging Control Protocol" },
|
|
|
|
{PPP_ECP, "Encryption Control Protocol" },
|
|
|
|
{PPP_ILECP, "Individual Encryption Control Protocol" },
|
|
|
|
{PPP_IPV6CP, "IPv6 Control Protocol" },
|
2002-01-03 20:30:33 +00:00
|
|
|
{PPP_MUXCP, "PPPMux Control Protocol"},
|
2002-08-18 15:30:38 +00:00
|
|
|
{PPP_STAMPEDECP,"Stampede Bridging Control Protocol" },
|
|
|
|
{PPP_MPPCP, "MP+ Contorol Protocol" },
|
|
|
|
{PPP_IPICP, "NTCITS IPI Control Protocol" },
|
|
|
|
{PPP_SLCC, "single link compression in multilink control" },
|
1999-08-25 06:52:04 +00:00
|
|
|
{PPP_CCP, "Compression Control Protocol" },
|
2002-08-18 15:30:38 +00:00
|
|
|
{PPP_CDPCP, "CDP Control Protocol" },
|
|
|
|
{PPP_NETCSCP, "Netcs Twin Routing" },
|
|
|
|
{PPP_STPCP, "STP - Control Protocol" },
|
|
|
|
{PPP_EDPCP, "EDP Control Protocol" },
|
|
|
|
{PPP_ACSPC, "Apple Client Server Protocol Control" },
|
|
|
|
{PPP_MPLSCP, "MPLS Control Protocol" },
|
|
|
|
{PPP_P12844CP, "IEEE p1284.4 standard - Protocol Control" },
|
|
|
|
{PPP_ETSICP, "ETSI TETRA TNP1 Control Protocol" },
|
|
|
|
{PPP_MFTPCP, "Multichannel Flow Treatment Protocol" },
|
1999-08-25 06:52:04 +00:00
|
|
|
{PPP_LCP, "Link Control Protocol" },
|
|
|
|
{PPP_PAP, "Password Authentication Protocol" },
|
|
|
|
{PPP_LQR, "Link Quality Report protocol" },
|
2001-08-05 10:09:40 +00:00
|
|
|
{PPP_SPAP, "Shiva Password Authentication Protocol" },
|
1999-08-25 06:52:04 +00:00
|
|
|
{PPP_CBCP, "Callback Control Protocol" },
|
2001-12-08 01:03:19 +00:00
|
|
|
{PPP_BACP, "Bandwidth Allocation Control Protocol" },
|
Add new routines:
tvb_get_string() - takes a tvbuff, an offset, and a length as
arguments, allocates a buffer big enough to hold a string with
the specified number of bytes plus an added null terminator
(i.e., length+1), copies the specified number of bytes from the
tvbuff, at the specified offset, to that buffer and puts in a
null terminator, and returns a pointer to that buffer (or throws
an exception before allocating the buffer if that many bytes
aren't available in the tvbuff);
tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to
a "gint" as arguments, gets the size of the null-terminated
string starting at the specified offset in the tvbuff (throwing
an exception if the null terminator isn't found), allocates a
buffer big enough to hold that string, copies the string to that
buffer, and returns a pointer to that buffer and stores the
length of the string (including the terminating null) in the
variable pointed to by the "gint" pointer.
Replace many pieces of code allocating a buffer and copying a string
with calls to "tvb_get_string()" (for one thing, "tvb_get_string()"
doesn't require you to remember that the argument to
"tvb_get_nstringz0()" is the size of the buffer into which you're
copying the string, which might be the length of the string to be copied
*plus 1*).
Don't use fixed-length buffers for null-terminated strings (even if the
code that generates those packets has a #define to limit the length of
the string). Use "tvb_get_stringz()", instead.
In some cases where a value is fetched but is only used to pass an
argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()"
instead.
svn path=/trunk/; revision=7859
2003-06-12 08:33:32 +00:00
|
|
|
{PPP_BAP, "Bandwidth Allocation Protocol" },
|
2002-08-18 15:30:38 +00:00
|
|
|
{PPP_CONTCP, "Container Control Protocol" },
|
Instead of tweaking a "Protocol configuration options" extension header
item to look more-or-less like a PPP packet, just dissect it in place
and hand off to the appropriate subdissector using the PPP dissector's
handoff table (which we export, along with its value_string table for
protocol IDs, which we use to report the protocol ID symbolically).
This means there's no point in having a configurable option to control
whether to do that tweaking; make it an obsolete option.
Bring "col_get_writable()" back from the dead, and have the GTP
dissector save the current "writable" flag for columns, mark the columns
non-writable before calling the subdissector for the PPP configuration
protocol, and restore the state of the writable flag, rather than
putting the columns back after the PPP configuration protocol's
dissector is done.
Fix some more typos in comments.
Don't register the IP dissector in the "ppp.protocol" table in the GTP
dissector's handoff registration routine - it's already being done in
the IP dissector's handoff routine.
Fix the name for CHAP to match what RFC 1994 calls it (if the name
changed, it should be changed in all places, but, at least according to
this message, a while ago, from Bob Sutterfield, "since the RFC defines
the protocol, the RFC defines the name":
http://mail-index.netbsd.org/netbsd-help/1996/05/16/0011.html
and the RFC defines the name as "PPP Challenge Handshake Authentication
Protocol (CHAP)").
svn path=/trunk/; revision=6617
2002-11-11 19:23:14 +00:00
|
|
|
{PPP_CHAP, "Challenge Handshake Authentication Protocol" },
|
2002-08-18 15:30:38 +00:00
|
|
|
{PPP_RSAAP, "RSA Authentication Protocol" },
|
|
|
|
{PPP_EAP, "Extensible Authentication Protocol" },
|
|
|
|
{PPP_SIEP, "Mitsubishi Security Information Exchange Protocol"},
|
|
|
|
{PPP_SBAP, "Stampede Bridging Authorization Protocol" },
|
|
|
|
{PPP_PRPAP, "Proprietary Authentication Protocol" },
|
|
|
|
{PPP_PRPAP2, "Proprietary Authentication Protocol" },
|
|
|
|
{PPP_PRPNIAP, "Proprietary Node ID Authentication Protocol" },
|
1999-08-25 06:52:04 +00:00
|
|
|
{0, NULL }
|
|
|
|
};
|
1999-06-11 15:30:55 +00:00
|
|
|
|
|
|
|
/* CP (LCP, IPCP, etc.) codes.
|
2002-08-28 21:04:11 +00:00
|
|
|
* from pppd fsm.h
|
1999-06-11 15:30:55 +00:00
|
|
|
*/
|
1999-08-25 07:32:46 +00:00
|
|
|
#define CONFREQ 1 /* Configuration Request */
|
|
|
|
#define CONFACK 2 /* Configuration Ack */
|
|
|
|
#define CONFNAK 3 /* Configuration Nak */
|
|
|
|
#define CONFREJ 4 /* Configuration Reject */
|
|
|
|
#define TERMREQ 5 /* Termination Request */
|
|
|
|
#define TERMACK 6 /* Termination Ack */
|
|
|
|
#define CODEREJ 7 /* Code Reject */
|
1999-06-11 15:30:55 +00:00
|
|
|
|
|
|
|
static const value_string cp_vals[] = {
|
1999-08-25 07:32:46 +00:00
|
|
|
{CONFREQ, "Configuration Request" },
|
|
|
|
{CONFACK, "Configuration Ack" },
|
|
|
|
{CONFNAK, "Configuration Nak" },
|
|
|
|
{CONFREJ, "Configuration Reject" },
|
|
|
|
{TERMREQ, "Termination Request" },
|
|
|
|
{TERMACK, "Termination Ack" },
|
|
|
|
{CODEREJ, "Code Reject" },
|
1999-08-25 06:52:04 +00:00
|
|
|
{0, NULL } };
|
1999-06-11 15:30:55 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* LCP-specific packet types.
|
|
|
|
*/
|
1999-08-25 07:32:46 +00:00
|
|
|
#define PROTREJ 8 /* Protocol Reject */
|
|
|
|
#define ECHOREQ 9 /* Echo Request */
|
|
|
|
#define ECHOREP 10 /* Echo Reply */
|
|
|
|
#define DISCREQ 11 /* Discard Request */
|
|
|
|
#define IDENT 12 /* Identification */
|
|
|
|
#define TIMEREMAIN 13 /* Time remaining */
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
/*
|
2001-10-29 19:48:45 +00:00
|
|
|
* CCP-specific packet types.
|
|
|
|
*/
|
|
|
|
#define RESETREQ 14 /* Reset Request */
|
|
|
|
#define RESETACK 15 /* Reset Ack */
|
|
|
|
|
2001-11-04 04:50:12 +00:00
|
|
|
/*
|
|
|
|
* CBCP-specific packet types.
|
|
|
|
*/
|
|
|
|
#define CBREQ 1 /* Callback Request */
|
|
|
|
#define CBRES 2 /* Callback Response */
|
|
|
|
#define CBACK 3 /* Callback Ack */
|
|
|
|
|
1999-06-11 15:30:55 +00:00
|
|
|
#define CBCP_OPT 6 /* Use callback control protocol */
|
|
|
|
|
2001-12-08 01:03:19 +00:00
|
|
|
/*
|
|
|
|
* BAP-specific packet types.
|
|
|
|
*/
|
|
|
|
#define BAP_CREQ 1 /* Call Request */
|
|
|
|
#define BAP_CRES 2 /* Call Response */
|
|
|
|
#define BAP_CBREQ 3 /* Callback Request */
|
|
|
|
#define BAP_CBRES 4 /* Callback Response */
|
|
|
|
#define BAP_LDQREQ 5 /* Link Drop Query Request */
|
|
|
|
#define BAP_LDQRES 6 /* Link Drop Query Response */
|
|
|
|
#define BAP_CSI 7 /* Call Status Indication */
|
|
|
|
#define BAP_CSRES 8 /* Call Status Response */
|
|
|
|
|
1999-06-11 15:30:55 +00:00
|
|
|
static const value_string lcp_vals[] = {
|
1999-08-25 07:32:46 +00:00
|
|
|
{CONFREQ, "Configuration Request" },
|
|
|
|
{CONFACK, "Configuration Ack" },
|
|
|
|
{CONFNAK, "Configuration Nak" },
|
|
|
|
{CONFREJ, "Configuration Reject" },
|
|
|
|
{TERMREQ, "Termination Request" },
|
|
|
|
{TERMACK, "Termination Ack" },
|
|
|
|
{CODEREJ, "Code Reject" },
|
|
|
|
{PROTREJ, "Protocol Reject" },
|
|
|
|
{ECHOREQ, "Echo Request" },
|
|
|
|
{ECHOREP, "Echo Reply" },
|
|
|
|
{DISCREQ, "Discard Request" },
|
|
|
|
{IDENT, "Identification" },
|
|
|
|
{TIMEREMAIN, "Time Remaining" },
|
|
|
|
{0, NULL }
|
|
|
|
};
|
1999-08-25 06:52:04 +00:00
|
|
|
|
2001-10-29 19:48:45 +00:00
|
|
|
static const value_string ccp_vals[] = {
|
|
|
|
{CONFREQ, "Configuration Request" },
|
|
|
|
{CONFACK, "Configuration Ack" },
|
|
|
|
{CONFNAK, "Configuration Nak" },
|
|
|
|
{CONFREJ, "Configuration Reject" },
|
|
|
|
{TERMREQ, "Termination Request" },
|
|
|
|
{TERMACK, "Termination Ack" },
|
|
|
|
{CODEREJ, "Code Reject" },
|
|
|
|
{RESETREQ, "Reset Request" },
|
|
|
|
{RESETACK, "Reset Ack" },
|
2002-08-28 21:04:11 +00:00
|
|
|
{0, NULL }
|
2001-10-29 19:48:45 +00:00
|
|
|
};
|
|
|
|
|
2001-11-04 04:50:12 +00:00
|
|
|
static const value_string cbcp_vals[] = {
|
|
|
|
{CBREQ, "Callback Request" },
|
|
|
|
{CBRES, "Callback Response" },
|
|
|
|
{CBACK, "Callback Ack" },
|
2002-08-28 21:04:11 +00:00
|
|
|
{0, NULL }
|
2001-11-04 04:50:12 +00:00
|
|
|
};
|
|
|
|
|
2001-12-08 01:03:19 +00:00
|
|
|
static const value_string bap_vals[] = {
|
|
|
|
{BAP_CREQ, "Call Request" },
|
|
|
|
{BAP_CRES, "Call Response" },
|
|
|
|
{BAP_CBREQ, "Callback Request" },
|
|
|
|
{BAP_CBRES, "Callback Response" },
|
|
|
|
{BAP_LDQREQ, "Link Drop Query Request" },
|
|
|
|
{BAP_LDQRES, "Link Drop Query Response" },
|
|
|
|
{BAP_CSI, "Call Status Indication" },
|
|
|
|
{BAP_CSRES, "Call Status Response" },
|
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
#define BAP_RESP_CODE_REQACK 0x00
|
|
|
|
#define BAP_RESP_CODE_REQNAK 0x01
|
|
|
|
#define BAP_RESP_CODE_REQREJ 0x02
|
|
|
|
#define BAP_RESP_CODE_REQFULLNAK 0x03
|
|
|
|
static const value_string bap_resp_code_vals[] = {
|
|
|
|
{BAP_RESP_CODE_REQACK, "Request Ack" },
|
|
|
|
{BAP_RESP_CODE_REQNAK, "Request Nak" },
|
|
|
|
{BAP_RESP_CODE_REQREJ, "Request Rej" },
|
|
|
|
{BAP_RESP_CODE_REQFULLNAK, "Request Full Nak" },
|
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
#define BAP_LINK_TYPE_ISDN 0 /* ISDN */
|
|
|
|
#define BAP_LINK_TYPE_X25 1 /* X.25 */
|
|
|
|
#define BAP_LINK_TYPE_ANALOG 2 /* Analog */
|
|
|
|
#define BAP_LINK_TYPE_SD 3 /* Switched Digital (non-ISDN) */
|
|
|
|
#define BAP_LINK_TYPE_ISDNOV 4 /* ISDN data over voice */
|
|
|
|
#define BAP_LINK_TYPE_RESV5 5 /* Reserved */
|
|
|
|
#define BAP_LINK_TYPE_RESV6 6 /* Reserved */
|
|
|
|
#define BAP_LINK_TYPE_RESV7 7 /* Reserved */
|
|
|
|
static const value_string bap_link_type_vals[] = {
|
|
|
|
{BAP_LINK_TYPE_ISDN, "ISDN" },
|
|
|
|
{BAP_LINK_TYPE_X25, "X.25" },
|
|
|
|
{BAP_LINK_TYPE_ANALOG, "Analog" },
|
|
|
|
{BAP_LINK_TYPE_SD, "Switched Digital (non-ISDN)" },
|
|
|
|
{BAP_LINK_TYPE_ISDNOV, "ISDN data over voice" },
|
|
|
|
{BAP_LINK_TYPE_RESV5, "Reserved" },
|
|
|
|
{BAP_LINK_TYPE_RESV6, "Reserved" },
|
|
|
|
{BAP_LINK_TYPE_RESV7, "Reserved" },
|
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
#define BAP_PHONE_DELTA_SUBOPT_UNIQ_DIGIT 1 /* Unique Digit */
|
|
|
|
#define BAP_PHONE_DELTA_SUBOPT_SUBSC_NUM 2 /* Subscriber Number */
|
|
|
|
#define BAP_PHONE_DELTA_SUBOPT_PHONENUM_SUBADDR 3 /* Phone Number Sub Address */
|
|
|
|
static const value_string bap_phone_delta_subopt_vals[] = {
|
|
|
|
{BAP_PHONE_DELTA_SUBOPT_UNIQ_DIGIT, "Unique Digit" },
|
|
|
|
{BAP_PHONE_DELTA_SUBOPT_SUBSC_NUM, "Subscriber Number" },
|
|
|
|
{BAP_PHONE_DELTA_SUBOPT_PHONENUM_SUBADDR, "Phone Number Sub Address" },
|
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Cause codes for Cause.
|
|
|
|
*
|
2002-08-28 21:04:11 +00:00
|
|
|
* The following code table is taken from packet-q931.c but is slightly
|
2001-12-08 01:03:19 +00:00
|
|
|
* adapted to BAP protocol.
|
|
|
|
*/
|
|
|
|
static const value_string q931_cause_code_vals[] = {
|
|
|
|
{ 0x00, "Call successful" },
|
|
|
|
{ 0x01, "Unallocated (unassigned) number" },
|
|
|
|
{ 0x02, "No route to specified transit network" },
|
|
|
|
{ 0x03, "No route to destination" },
|
|
|
|
{ 0x04, "Send special information tone" },
|
|
|
|
{ 0x05, "Misdialled trunk prefix" },
|
|
|
|
{ 0x06, "Channel unacceptable" },
|
|
|
|
{ 0x07, "Call awarded and being delivered in an established channel" },
|
|
|
|
{ 0x08, "Prefix 0 dialed but not allowed" },
|
|
|
|
{ 0x09, "Prefix 1 dialed but not allowed" },
|
|
|
|
{ 0x0A, "Prefix 1 dialed but not required" },
|
|
|
|
{ 0x0B, "More digits received than allowed, call is proceeding" },
|
|
|
|
{ 0x10, "Normal call clearing" },
|
|
|
|
{ 0x11, "User busy" },
|
|
|
|
{ 0x12, "No user responding" },
|
|
|
|
{ 0x13, "No answer from user (user alerted)" },
|
|
|
|
{ 0x14, "Subscriber absent" },
|
|
|
|
{ 0x15, "Call rejected" },
|
|
|
|
{ 0x16, "Number changed" },
|
|
|
|
{ 0x17, "Reverse charging rejected" },
|
|
|
|
{ 0x18, "Call suspended" },
|
|
|
|
{ 0x19, "Call resumed" },
|
|
|
|
{ 0x1A, "Non-selected user clearing" },
|
|
|
|
{ 0x1B, "Destination out of order" },
|
|
|
|
{ 0x1C, "Invalid number format (incomplete number)" },
|
|
|
|
{ 0x1D, "Facility rejected" },
|
|
|
|
{ 0x1E, "Response to STATUS ENQUIRY" },
|
|
|
|
{ 0x1F, "Normal unspecified" },
|
|
|
|
{ 0x21, "Circuit out of order" },
|
|
|
|
{ 0x22, "No circuit/channel available" },
|
|
|
|
{ 0x23, "Destination unattainable" },
|
|
|
|
{ 0x25, "Degraded service" },
|
|
|
|
{ 0x26, "Network out of order" },
|
|
|
|
{ 0x27, "Transit delay range cannot be achieved" },
|
|
|
|
{ 0x28, "Throughput range cannot be achieved" },
|
|
|
|
{ 0x29, "Temporary failure" },
|
|
|
|
{ 0x2A, "Switching equipment congestion" },
|
|
|
|
{ 0x2B, "Access information discarded" },
|
|
|
|
{ 0x2C, "Requested circuit/channel not available" },
|
|
|
|
{ 0x2D, "Pre-empted" },
|
|
|
|
{ 0x2E, "Precedence call blocked" },
|
|
|
|
{ 0x2F, "Resources unavailable, unspecified" },
|
|
|
|
{ 0x31, "Quality of service unavailable" },
|
|
|
|
{ 0x32, "Requested facility not subscribed" },
|
|
|
|
{ 0x33, "Reverse charging not allowed" },
|
|
|
|
{ 0x34, "Outgoing calls barred" },
|
|
|
|
{ 0x35, "Outgoing calls barred within CUG" },
|
|
|
|
{ 0x36, "Incoming calls barred" },
|
|
|
|
{ 0x37, "Incoming calls barred within CUG" },
|
|
|
|
{ 0x38, "Call waiting not subscribed" },
|
|
|
|
{ 0x39, "Bearer capability not authorized" },
|
|
|
|
{ 0x3A, "Bearer capability not presently available" },
|
|
|
|
{ 0x3E, "Inconsistency in designated outgoing access information and subscriber class" },
|
|
|
|
{ 0x3F, "Service or option not available, unspecified" },
|
|
|
|
{ 0x41, "Bearer capability not implemented" },
|
|
|
|
{ 0x42, "Channel type not implemented" },
|
|
|
|
{ 0x43, "Transit network selection not implemented" },
|
|
|
|
{ 0x44, "Message not implemented" },
|
|
|
|
{ 0x45, "Requested facility not implemented" },
|
|
|
|
{ 0x46, "Only restricted digital information bearer capability is available" },
|
|
|
|
{ 0x4F, "Service or option not implemented, unspecified" },
|
|
|
|
{ 0x51, "Invalid call reference value" },
|
|
|
|
{ 0x52, "Identified channel does not exist" },
|
|
|
|
{ 0x53, "Call identity does not exist for suspended call" },
|
|
|
|
{ 0x54, "Call identity in use" },
|
|
|
|
{ 0x55, "No call suspended" },
|
|
|
|
{ 0x56, "Call having the requested call identity has been cleared" },
|
|
|
|
{ 0x57, "Called user not member of CUG" },
|
|
|
|
{ 0x58, "Incompatible destination" },
|
|
|
|
{ 0x59, "Non-existent abbreviated address entry" },
|
|
|
|
{ 0x5A, "Destination address missing, and direct call not subscribed" },
|
|
|
|
{ 0x5B, "Invalid transit network selection (national use)" },
|
|
|
|
{ 0x5C, "Invalid facility parameter" },
|
|
|
|
{ 0x5D, "Mandatory information element is missing" },
|
|
|
|
{ 0x5F, "Invalid message, unspecified" },
|
|
|
|
{ 0x60, "Mandatory information element is missing" },
|
|
|
|
{ 0x61, "Message type non-existent or not implemented" },
|
|
|
|
{ 0x62, "Message not compatible with call state or message type non-existent or not implemented" },
|
|
|
|
{ 0x63, "Information element nonexistant or not implemented" },
|
|
|
|
{ 0x64, "Invalid information element contents" },
|
|
|
|
{ 0x65, "Message not compatible with call state" },
|
|
|
|
{ 0x66, "Recovery on timer expiry" },
|
|
|
|
{ 0x67, "Parameter non-existent or not implemented - passed on" },
|
|
|
|
{ 0x6E, "Message with unrecognized parameter discarded" },
|
|
|
|
{ 0x6F, "Protocol error, unspecified" },
|
|
|
|
{ 0x7F, "Internetworking, unspecified" },
|
|
|
|
{ 0xFF, "Non-specific failure" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string bap_call_status_opt_action_vals[] = {
|
|
|
|
{0, "No retry" },
|
|
|
|
{1, "Retry" },
|
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
2001-10-29 19:48:45 +00:00
|
|
|
#define STAC_CM_NONE 0
|
|
|
|
#define STAC_CM_LCB 1
|
|
|
|
#define STAC_CM_CRC 2
|
|
|
|
#define STAC_CM_SN 3
|
|
|
|
#define STAC_CM_EXTMODE 4
|
|
|
|
static const value_string stac_checkmode_vals[] = {
|
|
|
|
{STAC_CM_NONE, "None" },
|
|
|
|
{STAC_CM_LCB, "LCB" },
|
|
|
|
{STAC_CM_CRC, "CRC" },
|
|
|
|
{STAC_CM_SN, "Sequence Number" },
|
|
|
|
{STAC_CM_EXTMODE, "Extended Mode" },
|
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
#define LZSDCP_CM_NONE 0
|
|
|
|
#define LZSDCP_CM_LCB 1
|
|
|
|
#define LZSDCP_CM_SN 2
|
|
|
|
#define LZSDCP_CM_SN_LCB 3
|
|
|
|
static const value_string lzsdcp_checkmode_vals[] = {
|
|
|
|
{LZSDCP_CM_NONE, "None" },
|
|
|
|
{LZSDCP_CM_LCB, "LCB" },
|
|
|
|
{LZSDCP_CM_SN, "Sequence Number" },
|
|
|
|
{LZSDCP_CM_SN_LCB, "Sequence Number + LCB" },
|
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
#define LZSDCP_PM_NONE 0
|
|
|
|
#define LZSDCP_PM_PROC_UNCOMP 1
|
|
|
|
static const value_string lzsdcp_processmode_vals[] = {
|
|
|
|
{LZSDCP_PM_NONE, "None" },
|
|
|
|
{LZSDCP_PM_PROC_UNCOMP, "Process-Uncompressed" },
|
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
1999-06-11 15:30:55 +00:00
|
|
|
/*
|
|
|
|
* Options. (LCP)
|
|
|
|
*/
|
1999-08-25 06:52:04 +00:00
|
|
|
#define CI_MRU 1 /* Maximum Receive Unit */
|
|
|
|
#define CI_ASYNCMAP 2 /* Async Control Character Map */
|
|
|
|
#define CI_AUTHTYPE 3 /* Authentication Type */
|
|
|
|
#define CI_QUALITY 4 /* Quality Protocol */
|
|
|
|
#define CI_MAGICNUMBER 5 /* Magic Number */
|
|
|
|
#define CI_PCOMPRESSION 7 /* Protocol Field Compression */
|
|
|
|
#define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */
|
1999-08-28 08:31:28 +00:00
|
|
|
#define CI_FCS_ALTERNATIVES 9 /* FCS Alternatives (RFC 1570) */
|
1999-08-25 07:32:46 +00:00
|
|
|
#define CI_SELF_DESCRIBING_PAD 10 /* Self-Describing Pad (RFC 1570) */
|
|
|
|
#define CI_NUMBERED_MODE 11 /* Numbered Mode (RFC 1663) */
|
|
|
|
#define CI_CALLBACK 13 /* Callback (RFC 1570) */
|
1999-08-28 08:31:28 +00:00
|
|
|
#define CI_COMPOUND_FRAMES 15 /* Compound frames (RFC 1570) */
|
1999-08-25 07:32:46 +00:00
|
|
|
#define CI_MULTILINK_MRRU 17 /* Multilink MRRU (RFC 1717) */
|
|
|
|
#define CI_MULTILINK_SSNH 18 /* Multilink Short Sequence Number
|
|
|
|
Header (RFC 1717) */
|
|
|
|
#define CI_MULTILINK_EP_DISC 19 /* Multilink Endpoint Discriminator
|
|
|
|
(RFC 1717) */
|
|
|
|
#define CI_DCE_IDENTIFIER 21 /* DCE Identifier */
|
|
|
|
#define CI_MULTILINK_PLUS_PROC 22 /* Multilink Plus Procedure */
|
|
|
|
#define CI_LINK_DISC_FOR_BACP 23 /* Link Discriminator for BACP
|
|
|
|
(RFC 2125) */
|
|
|
|
#define CI_LCP_AUTHENTICATION 24 /* LCP Authentication Option */
|
|
|
|
#define CI_COBS 25 /* Consistent Overhead Byte
|
|
|
|
Stuffing */
|
|
|
|
#define CI_PREFIX_ELISION 26 /* Prefix elision */
|
|
|
|
#define CI_MULTILINK_HDR_FMT 27 /* Multilink header format */
|
|
|
|
#define CI_INTERNATIONALIZATION 28 /* Internationalization (RFC 2484) */
|
|
|
|
#define CI_SDL_ON_SONET_SDH 29 /* Simple Data Link on SONET/SDH */
|
1999-06-11 15:30:55 +00:00
|
|
|
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
static void dissect_lcp_mru_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2001-12-10 00:26:21 +00:00
|
|
|
int offset, guint length, packet_info *pinfo,
|
Add a "col_clear()" routine, to clear a column; it appears (and it
doesn't just seem to be a profiling artifact) that, at least on FreeBSD
3.4, it's significantly more efficient to clear out a column by stuffing
a '\0' into the first byte of the column data than to do so by copying a
null string (I guess when copying one byte, the fixed overhead of the
procedure call and of "strcpy()" is significant).
Have the TCP dissector set the Protocol column, and clear the Info
column, before doing anything that might cause an exception to be
thrown, so that if we *do* get an exception thrown, the frame at least
shows up as TCP.
Instead of, in the TCP dissector, constructing a string and then
stuffing it into the Info column, just append to the Info column, which
avoids one string copy.
Pass a "frame_data" pointer to dissectors for TCP and IP (and PPP)
options, so they can use it to append to the Info column.
svn path=/trunk/; revision=2744
2000-12-04 06:37:46 +00:00
|
|
|
proto_tree *tree);
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
static void dissect_lcp_async_map_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2001-12-10 00:26:21 +00:00
|
|
|
int offset, guint length, packet_info *pinfo,
|
Add a "col_clear()" routine, to clear a column; it appears (and it
doesn't just seem to be a profiling artifact) that, at least on FreeBSD
3.4, it's significantly more efficient to clear out a column by stuffing
a '\0' into the first byte of the column data than to do so by copying a
null string (I guess when copying one byte, the fixed overhead of the
procedure call and of "strcpy()" is significant).
Have the TCP dissector set the Protocol column, and clear the Info
column, before doing anything that might cause an exception to be
thrown, so that if we *do* get an exception thrown, the frame at least
shows up as TCP.
Instead of, in the TCP dissector, constructing a string and then
stuffing it into the Info column, just append to the Info column, which
avoids one string copy.
Pass a "frame_data" pointer to dissectors for TCP and IP (and PPP)
options, so they can use it to append to the Info column.
svn path=/trunk/; revision=2744
2000-12-04 06:37:46 +00:00
|
|
|
proto_tree *tree);
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
static void dissect_lcp_protocol_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2001-12-10 00:26:21 +00:00
|
|
|
int offset, guint length, packet_info *pinfo,
|
Add a "col_clear()" routine, to clear a column; it appears (and it
doesn't just seem to be a profiling artifact) that, at least on FreeBSD
3.4, it's significantly more efficient to clear out a column by stuffing
a '\0' into the first byte of the column data than to do so by copying a
null string (I guess when copying one byte, the fixed overhead of the
procedure call and of "strcpy()" is significant).
Have the TCP dissector set the Protocol column, and clear the Info
column, before doing anything that might cause an exception to be
thrown, so that if we *do* get an exception thrown, the frame at least
shows up as TCP.
Instead of, in the TCP dissector, constructing a string and then
stuffing it into the Info column, just append to the Info column, which
avoids one string copy.
Pass a "frame_data" pointer to dissectors for TCP and IP (and PPP)
options, so they can use it to append to the Info column.
svn path=/trunk/; revision=2744
2000-12-04 06:37:46 +00:00
|
|
|
proto_tree *tree);
|
2001-08-05 19:44:13 +00:00
|
|
|
static void dissect_lcp_authprot_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2001-12-10 00:26:21 +00:00
|
|
|
int offset, guint length, packet_info *pinfo,
|
2001-08-05 19:44:13 +00:00
|
|
|
proto_tree *tree);
|
1999-08-28 08:31:28 +00:00
|
|
|
static void dissect_lcp_magicnumber_opt(const ip_tcp_opt *optp,
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
tvbuff_t *tvb, int offset, guint length,
|
2001-12-10 00:26:21 +00:00
|
|
|
packet_info *pinfo, proto_tree *tree);
|
1999-08-28 08:31:28 +00:00
|
|
|
static void dissect_lcp_fcs_alternatives_opt(const ip_tcp_opt *optp,
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
tvbuff_t *tvb, int offset, guint length,
|
2001-12-10 00:26:21 +00:00
|
|
|
packet_info *pinfo, proto_tree *tree);
|
1999-08-28 08:31:28 +00:00
|
|
|
static void dissect_lcp_numbered_mode_opt(const ip_tcp_opt *optp,
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
tvbuff_t *tvb, int offset, guint length,
|
2001-12-10 00:26:21 +00:00
|
|
|
packet_info *pinfo, proto_tree *tree);
|
1999-08-28 08:31:28 +00:00
|
|
|
static void dissect_lcp_self_describing_pad_opt(const ip_tcp_opt *optp,
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
tvbuff_t *tvb, int offset, guint length,
|
2001-12-10 00:26:21 +00:00
|
|
|
packet_info *pinfo, proto_tree *tree);
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
static void dissect_lcp_callback_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2001-12-10 00:26:21 +00:00
|
|
|
int offset, guint length, packet_info *pinfo,
|
Add a "col_clear()" routine, to clear a column; it appears (and it
doesn't just seem to be a profiling artifact) that, at least on FreeBSD
3.4, it's significantly more efficient to clear out a column by stuffing
a '\0' into the first byte of the column data than to do so by copying a
null string (I guess when copying one byte, the fixed overhead of the
procedure call and of "strcpy()" is significant).
Have the TCP dissector set the Protocol column, and clear the Info
column, before doing anything that might cause an exception to be
thrown, so that if we *do* get an exception thrown, the frame at least
shows up as TCP.
Instead of, in the TCP dissector, constructing a string and then
stuffing it into the Info column, just append to the Info column, which
avoids one string copy.
Pass a "frame_data" pointer to dissectors for TCP and IP (and PPP)
options, so they can use it to append to the Info column.
svn path=/trunk/; revision=2744
2000-12-04 06:37:46 +00:00
|
|
|
proto_tree *tree);
|
1999-08-28 08:31:28 +00:00
|
|
|
static void dissect_lcp_multilink_mrru_opt(const ip_tcp_opt *optp,
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
tvbuff_t *tvb, int offset, guint length,
|
2001-12-10 00:26:21 +00:00
|
|
|
packet_info *pinfo, proto_tree *tree);
|
1999-08-28 08:31:28 +00:00
|
|
|
static void dissect_lcp_multilink_ep_disc_opt(const ip_tcp_opt *optp,
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
tvbuff_t *tvb, int offset, guint length,
|
2001-12-10 00:26:21 +00:00
|
|
|
packet_info *pinfo, proto_tree *tree);
|
1999-08-28 08:31:28 +00:00
|
|
|
static void dissect_lcp_bap_link_discriminator_opt(const ip_tcp_opt *optp,
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
tvbuff_t *tvb, int offset, guint length,
|
2001-12-10 00:26:21 +00:00
|
|
|
packet_info *pinfo, proto_tree *tree);
|
1999-08-28 08:31:28 +00:00
|
|
|
static void dissect_lcp_internationalization_opt(const ip_tcp_opt *optp,
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
tvbuff_t *tvb, int offset, guint length,
|
2001-12-10 00:26:21 +00:00
|
|
|
packet_info *pinfo, proto_tree *tree);
|
2000-05-25 07:42:26 +00:00
|
|
|
static void dissect_mp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
|
1999-08-28 08:31:28 +00:00
|
|
|
|
|
|
|
static const ip_tcp_opt lcp_opts[] = {
|
|
|
|
{
|
|
|
|
CI_MRU,
|
|
|
|
"Maximum Receive Unit",
|
2002-04-01 00:51:43 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
4,
|
|
|
|
dissect_lcp_mru_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_ASYNCMAP,
|
|
|
|
"Async Control Character Map",
|
2002-04-01 00:51:43 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
6,
|
|
|
|
dissect_lcp_async_map_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_AUTHTYPE,
|
|
|
|
"Authentication protocol",
|
1999-11-16 11:44:20 +00:00
|
|
|
&ett_lcp_authprot_opt,
|
1999-08-28 08:31:28 +00:00
|
|
|
VARIABLE_LENGTH,
|
|
|
|
4,
|
2001-08-05 19:44:13 +00:00
|
|
|
dissect_lcp_authprot_opt
|
1999-08-28 08:31:28 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_QUALITY,
|
|
|
|
"Quality protocol",
|
1999-11-16 11:44:20 +00:00
|
|
|
&ett_lcp_qualprot_opt,
|
1999-08-28 08:31:28 +00:00
|
|
|
VARIABLE_LENGTH,
|
|
|
|
4,
|
|
|
|
dissect_lcp_protocol_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_MAGICNUMBER,
|
2002-03-31 22:37:09 +00:00
|
|
|
"Magic number",
|
2002-04-01 00:51:43 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
6,
|
|
|
|
dissect_lcp_magicnumber_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_PCOMPRESSION,
|
|
|
|
"Protocol field compression",
|
1999-11-16 11:44:20 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
2,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_ACCOMPRESSION,
|
|
|
|
"Address/control field compression",
|
1999-11-16 11:44:20 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
2,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_FCS_ALTERNATIVES,
|
2002-03-31 22:37:09 +00:00
|
|
|
"FCS alternatives",
|
1999-11-16 11:44:20 +00:00
|
|
|
&ett_lcp_fcs_alternatives_opt,
|
1999-08-28 08:31:28 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
3,
|
|
|
|
dissect_lcp_fcs_alternatives_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_SELF_DESCRIBING_PAD,
|
2002-03-31 22:37:09 +00:00
|
|
|
"Maximum octets of self-describing padding",
|
1999-11-16 11:44:20 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
3,
|
|
|
|
dissect_lcp_self_describing_pad_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_NUMBERED_MODE,
|
|
|
|
"Numbered mode",
|
1999-11-16 11:44:20 +00:00
|
|
|
&ett_lcp_numbered_mode_opt,
|
1999-08-28 08:31:28 +00:00
|
|
|
VARIABLE_LENGTH,
|
|
|
|
4,
|
|
|
|
dissect_lcp_numbered_mode_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_CALLBACK,
|
|
|
|
"Callback",
|
1999-11-16 11:44:20 +00:00
|
|
|
&ett_lcp_callback_opt,
|
1999-08-28 08:31:28 +00:00
|
|
|
VARIABLE_LENGTH,
|
|
|
|
3,
|
|
|
|
dissect_lcp_callback_opt,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_COMPOUND_FRAMES,
|
|
|
|
"Compound frames",
|
1999-11-16 11:44:20 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
2,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_MULTILINK_MRRU,
|
2002-03-31 22:37:09 +00:00
|
|
|
"Multilink MRRU",
|
1999-11-16 11:44:20 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
4,
|
|
|
|
dissect_lcp_multilink_mrru_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_MULTILINK_SSNH,
|
|
|
|
"Use short sequence number headers",
|
1999-11-16 11:44:20 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
2,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_MULTILINK_EP_DISC,
|
|
|
|
"Multilink endpoint discriminator",
|
1999-11-16 11:44:20 +00:00
|
|
|
&ett_lcp_multilink_ep_disc_opt,
|
1999-08-28 08:31:28 +00:00
|
|
|
VARIABLE_LENGTH,
|
|
|
|
3,
|
|
|
|
dissect_lcp_multilink_ep_disc_opt,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_DCE_IDENTIFIER,
|
|
|
|
"DCE identifier",
|
1999-11-16 11:44:20 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
VARIABLE_LENGTH,
|
|
|
|
2,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_MULTILINK_PLUS_PROC,
|
|
|
|
"Multilink Plus Procedure",
|
1999-11-16 11:44:20 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
VARIABLE_LENGTH,
|
|
|
|
2,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_LINK_DISC_FOR_BACP,
|
2002-03-31 22:37:09 +00:00
|
|
|
"Link discriminator for BAP",
|
1999-11-16 11:44:20 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
4,
|
|
|
|
dissect_lcp_bap_link_discriminator_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_LCP_AUTHENTICATION,
|
|
|
|
"LCP authentication",
|
1999-11-16 11:44:20 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
VARIABLE_LENGTH,
|
|
|
|
2,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_COBS,
|
|
|
|
"Consistent Overhead Byte Stuffing",
|
1999-11-16 11:44:20 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
VARIABLE_LENGTH,
|
|
|
|
2,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_PREFIX_ELISION,
|
|
|
|
"Prefix elision",
|
1999-11-16 11:44:20 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
VARIABLE_LENGTH,
|
|
|
|
2,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_MULTILINK_HDR_FMT,
|
|
|
|
"Multilink header format",
|
1999-11-16 11:44:20 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
VARIABLE_LENGTH,
|
|
|
|
2,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_INTERNATIONALIZATION,
|
|
|
|
"Internationalization",
|
1999-11-16 11:44:20 +00:00
|
|
|
&ett_lcp_internationalization_opt,
|
1999-08-28 08:31:28 +00:00
|
|
|
VARIABLE_LENGTH,
|
|
|
|
7,
|
|
|
|
dissect_lcp_internationalization_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_SDL_ON_SONET_SDH,
|
|
|
|
"Simple data link on SONET/SDH",
|
1999-11-16 11:44:20 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
VARIABLE_LENGTH,
|
|
|
|
2,
|
|
|
|
NULL
|
|
|
|
}
|
1999-08-25 06:52:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define N_LCP_OPTS (sizeof lcp_opts / sizeof lcp_opts[0])
|
1999-06-11 15:30:55 +00:00
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
/*
|
2001-08-05 19:44:13 +00:00
|
|
|
* CHAP Algorithms
|
|
|
|
*/
|
|
|
|
#define CHAP_ALG_MD5 0x05 /* CHAP with MD5 */
|
|
|
|
#define CHAP_ALG_MSV1 0x80 /* MS-CHAPv1 */
|
|
|
|
#define CHAP_ALG_MSV2 0x81 /* MS-CHAPv2 */
|
|
|
|
|
|
|
|
static const value_string chap_alg_vals[] = {
|
|
|
|
{CHAP_ALG_MD5, "CHAP with MD5" },
|
|
|
|
{CHAP_ALG_MSV1, "MS-CHAP" },
|
|
|
|
{CHAP_ALG_MSV2, "MS-CHAP-2" },
|
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
1999-06-11 15:30:55 +00:00
|
|
|
/*
|
|
|
|
* Options. (IPCP)
|
|
|
|
*/
|
1999-08-28 08:31:28 +00:00
|
|
|
#define CI_ADDRS 1 /* IP Addresses (deprecated) (RFC 1172) */
|
1999-08-25 07:32:46 +00:00
|
|
|
#define CI_COMPRESSTYPE 2 /* Compression Type (RFC 1332) */
|
|
|
|
#define CI_ADDR 3 /* IP Address (RFC 1332) */
|
|
|
|
#define CI_MOBILE_IPv4 4 /* Mobile IPv4 (RFC 2290) */
|
|
|
|
#define CI_MS_DNS1 129 /* Primary DNS value (RFC 1877) */
|
|
|
|
#define CI_MS_WINS1 130 /* Primary WINS value (RFC 1877) */
|
|
|
|
#define CI_MS_DNS2 131 /* Secondary DNS value (RFC 1877) */
|
|
|
|
#define CI_MS_WINS2 132 /* Secondary WINS value (RFC 1877) */
|
1999-06-11 15:30:55 +00:00
|
|
|
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
static void dissect_ipcp_addrs_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2001-12-10 00:26:21 +00:00
|
|
|
int offset, guint length, packet_info *pinfo,
|
Add a "col_clear()" routine, to clear a column; it appears (and it
doesn't just seem to be a profiling artifact) that, at least on FreeBSD
3.4, it's significantly more efficient to clear out a column by stuffing
a '\0' into the first byte of the column data than to do so by copying a
null string (I guess when copying one byte, the fixed overhead of the
procedure call and of "strcpy()" is significant).
Have the TCP dissector set the Protocol column, and clear the Info
column, before doing anything that might cause an exception to be
thrown, so that if we *do* get an exception thrown, the frame at least
shows up as TCP.
Instead of, in the TCP dissector, constructing a string and then
stuffing it into the Info column, just append to the Info column, which
avoids one string copy.
Pass a "frame_data" pointer to dissectors for TCP and IP (and PPP)
options, so they can use it to append to the Info column.
svn path=/trunk/; revision=2744
2000-12-04 06:37:46 +00:00
|
|
|
proto_tree *tree);
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
static void dissect_ipcp_addr_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2001-12-10 00:26:21 +00:00
|
|
|
int offset, guint length, packet_info *pinfo,
|
Add a "col_clear()" routine, to clear a column; it appears (and it
doesn't just seem to be a profiling artifact) that, at least on FreeBSD
3.4, it's significantly more efficient to clear out a column by stuffing
a '\0' into the first byte of the column data than to do so by copying a
null string (I guess when copying one byte, the fixed overhead of the
procedure call and of "strcpy()" is significant).
Have the TCP dissector set the Protocol column, and clear the Info
column, before doing anything that might cause an exception to be
thrown, so that if we *do* get an exception thrown, the frame at least
shows up as TCP.
Instead of, in the TCP dissector, constructing a string and then
stuffing it into the Info column, just append to the Info column, which
avoids one string copy.
Pass a "frame_data" pointer to dissectors for TCP and IP (and PPP)
options, so they can use it to append to the Info column.
svn path=/trunk/; revision=2744
2000-12-04 06:37:46 +00:00
|
|
|
proto_tree *tree);
|
2004-11-12 10:17:13 +00:00
|
|
|
static void dissect_ipcp_compress_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
|
|
|
int offset, guint length, packet_info *pinfo,
|
|
|
|
proto_tree *tree);
|
|
|
|
static void dissect_ipcp_iphc_disableprot_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
|
|
|
int offset, guint length, packet_info *pinfo,
|
|
|
|
proto_tree *tree);
|
1999-08-28 08:31:28 +00:00
|
|
|
|
|
|
|
static const ip_tcp_opt ipcp_opts[] = {
|
|
|
|
{
|
|
|
|
CI_ADDRS,
|
|
|
|
"IP addresses (deprecated)",
|
1999-11-16 11:44:20 +00:00
|
|
|
&ett_ipcp_ipaddrs_opt,
|
1999-08-28 08:31:28 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
10,
|
|
|
|
dissect_ipcp_addrs_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_COMPRESSTYPE,
|
2004-11-12 10:17:13 +00:00
|
|
|
"IP compression",
|
2004-11-22 02:12:43 +00:00
|
|
|
&ett_ipcp_compress_opt,
|
1999-08-28 08:31:28 +00:00
|
|
|
VARIABLE_LENGTH,
|
|
|
|
4,
|
2004-11-12 10:17:13 +00:00
|
|
|
dissect_ipcp_compress_opt
|
1999-08-28 08:31:28 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_ADDR,
|
|
|
|
"IP address",
|
1999-11-16 11:44:20 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
6,
|
|
|
|
dissect_ipcp_addr_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_MOBILE_IPv4,
|
|
|
|
"Mobile node's home IP address",
|
1999-11-16 11:44:20 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
6,
|
|
|
|
dissect_ipcp_addr_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_MS_DNS1,
|
|
|
|
"Primary DNS server IP address",
|
1999-11-16 11:44:20 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
6,
|
|
|
|
dissect_ipcp_addr_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_MS_WINS1,
|
|
|
|
"Primary WINS server IP address",
|
1999-11-16 11:44:20 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
6,
|
|
|
|
dissect_ipcp_addr_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_MS_DNS2,
|
|
|
|
"Secondary DNS server IP address",
|
1999-11-16 11:44:20 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
6,
|
|
|
|
dissect_ipcp_addr_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_MS_WINS2,
|
|
|
|
"Secondary WINS server IP address",
|
1999-11-16 11:44:20 +00:00
|
|
|
NULL,
|
1999-08-28 08:31:28 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
6,
|
|
|
|
dissect_ipcp_addr_opt
|
|
|
|
}
|
1999-08-25 06:52:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define N_IPCP_OPTS (sizeof ipcp_opts / sizeof ipcp_opts[0])
|
1999-06-11 15:30:55 +00:00
|
|
|
|
2004-11-12 10:17:13 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* IP Compression options
|
|
|
|
*/
|
|
|
|
#define IPCP_COMPRESS_VJ_1172 0x37 /* value defined in RFC1172 (typo) */
|
|
|
|
#define IPCP_COMPRESS_VJ 0x2d /* value defined in RFC1332 (correct) */
|
|
|
|
#define IPCP_COMPRESS_IPHC 0x61
|
|
|
|
|
|
|
|
const value_string ipcp_compress_proto_vals[] = {
|
|
|
|
{ IPCP_COMPRESS_VJ_1172, "VJ compression (RFC1172-typo)" },
|
|
|
|
{ IPCP_COMPRESS_VJ, "VJ compression" },
|
|
|
|
{ IPCP_COMPRESS_IPHC, "IPHC compression" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
/* IPHC suboptions (RFC2508, 3544) */
|
|
|
|
#define IPCP_IPHC_CRTP 1
|
|
|
|
#define IPCP_IPHC_ECRTP 2
|
|
|
|
#define IPCP_IPHC_DISABLE_PROTO 3 /* Disable compression for protocol */
|
|
|
|
|
|
|
|
const value_string ipcp_iphc_disable_proto_vals[] = {
|
|
|
|
{ 1, "TCP" },
|
|
|
|
{ 2, "Non-TCP" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const ip_tcp_opt ipcp_iphc_subopts[] = {
|
|
|
|
{
|
|
|
|
IPCP_IPHC_CRTP,
|
|
|
|
"RTP compression (RFC2508)",
|
|
|
|
NULL,
|
|
|
|
FIXED_LENGTH,
|
|
|
|
2,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
IPCP_IPHC_CRTP,
|
|
|
|
"Enhanced RTP compression (RFC3545)",
|
|
|
|
NULL,
|
|
|
|
FIXED_LENGTH,
|
|
|
|
2,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
IPCP_IPHC_DISABLE_PROTO,
|
|
|
|
"Enhanced RTP compression (RFC3545)",
|
|
|
|
&ett_ipcp_iphc_disableprot_opt,
|
|
|
|
FIXED_LENGTH,
|
|
|
|
3,
|
|
|
|
dissect_ipcp_iphc_disableprot_opt
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
#define N_IPCP_IPHC_SUBOPTS (sizeof ipcp_iphc_subopts / sizeof ipcp_iphc_subopts[0])
|
|
|
|
|
|
|
|
|
2004-04-29 20:21:28 +00:00
|
|
|
/*
|
|
|
|
* Options. (OSICP)
|
|
|
|
*/
|
|
|
|
#define CI_OSICP_ALIGN_NPDU 1 /* Alignment of the OSI NPDU (RFC 1377) */
|
|
|
|
|
|
|
|
static void dissect_osicp_align_npdu_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
|
|
|
int offset, guint length, packet_info *pinfo,
|
|
|
|
proto_tree *tree);
|
|
|
|
|
|
|
|
static const ip_tcp_opt osicp_opts[] = {
|
|
|
|
{
|
|
|
|
CI_OSICP_ALIGN_NPDU,
|
|
|
|
"Align-NPDU",
|
|
|
|
&ett_osicp_align_npdu_opt,
|
|
|
|
FIXED_LENGTH,
|
|
|
|
3,
|
|
|
|
dissect_osicp_align_npdu_opt
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#define N_OSICP_OPTS (sizeof osicp_opts / sizeof osicp_opts[0])
|
|
|
|
|
2001-10-29 19:48:45 +00:00
|
|
|
/*
|
|
|
|
* Options. (CCP)
|
|
|
|
*/
|
|
|
|
#define CI_CCP_OUI 0 /* OUI (RFC1962) */
|
|
|
|
#define CI_CCP_PREDICT1 1 /* Predictor type 1 (RFC1962) */
|
|
|
|
#define CI_CCP_PREDICT2 2 /* Predictor type 2 (RFC1962) */
|
|
|
|
#define CI_CCP_PUDDLE 3 /* Puddle Jumper (RFC1962) */
|
|
|
|
#define CI_CCP_HPPPC 16 /* Hewlett-Packard PPC (RFC1962) */
|
|
|
|
#define CI_CCP_STAC 17 /* stac Electronics LZS (RFC1974) */
|
|
|
|
#define CI_CCP_MPPC 18 /* Microsoft PPC (RFC2218/3078) */
|
2002-01-11 21:37:10 +00:00
|
|
|
#define CI_CCP_GFZA 19 /* Gandalf FZA (RFC1962) */
|
2001-10-29 19:48:45 +00:00
|
|
|
#define CI_CCP_V42BIS 20 /* V.42bis compression */
|
2002-01-11 21:37:10 +00:00
|
|
|
#define CI_CCP_BSDLZW 21 /* BSD LZW Compress (RFC1977) */
|
2001-10-29 19:48:45 +00:00
|
|
|
#define CI_CCP_LZSDCP 23 /* LZS-DCP (RFC1967) */
|
|
|
|
#define CI_CCP_MVRCA 24 /* MVRCA (Magnalink) (RFC1975) */
|
|
|
|
#define CI_CCP_DEFLATE 26 /* Deflate (RFC1979) */
|
|
|
|
#define CI_CCP_RESERVED 255 /* Reserved (RFC1962) */
|
|
|
|
|
|
|
|
/*
|
2002-08-28 21:04:11 +00:00
|
|
|
* Microsoft Point-To-Point Compression (MPPC) and Encryption (MPPE)
|
2001-10-29 19:48:45 +00:00
|
|
|
* supported bits.
|
|
|
|
*/
|
|
|
|
#define MPPC_SUPPORTED_BITS_C 0x00000001 /* MPPC negotiation */
|
|
|
|
#define MPPE_SUPPORTED_BITS_D 0x00000010 /* Obsolete */
|
|
|
|
#define MPPE_SUPPORTED_BITS_L 0x00000020 /* 40-bit encryption */
|
2001-10-30 10:16:51 +00:00
|
|
|
#define MPPE_SUPPORTED_BITS_S 0x00000040 /* 128-bit encryption */
|
|
|
|
#define MPPE_SUPPORTED_BITS_M 0x00000080 /* 56-bit encryption */
|
2001-10-29 19:48:45 +00:00
|
|
|
#define MPPE_SUPPORTED_BITS_H 0x01000000 /* stateless mode */
|
|
|
|
|
|
|
|
static void dissect_ccp_stac_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2001-12-10 00:26:21 +00:00
|
|
|
int offset, guint length, packet_info *pinfo,
|
2001-10-29 19:48:45 +00:00
|
|
|
proto_tree *tree);
|
|
|
|
|
|
|
|
static void dissect_ccp_mppc_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2001-12-10 00:26:21 +00:00
|
|
|
int offset, guint length, packet_info *pinfo,
|
2001-10-29 19:48:45 +00:00
|
|
|
proto_tree *tree);
|
|
|
|
|
2002-01-11 21:37:10 +00:00
|
|
|
static void dissect_ccp_bsdcomp_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
|
|
|
int offset, guint length, packet_info *pinfo,
|
|
|
|
proto_tree *tree);
|
|
|
|
|
2001-10-29 19:48:45 +00:00
|
|
|
static void dissect_ccp_lzsdcp_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2001-12-10 00:26:21 +00:00
|
|
|
int offset, guint length, packet_info *pinfo,
|
2001-10-29 19:48:45 +00:00
|
|
|
proto_tree *tree);
|
|
|
|
|
2002-01-11 21:37:10 +00:00
|
|
|
static void dissect_ccp_mvrca_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
|
|
|
int offset, guint length, packet_info *pinfo,
|
|
|
|
proto_tree *tree);
|
|
|
|
|
|
|
|
static void dissect_ccp_deflate_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
|
|
|
int offset, guint length, packet_info *pinfo,
|
|
|
|
proto_tree *tree);
|
|
|
|
|
2001-10-29 19:48:45 +00:00
|
|
|
static const ip_tcp_opt ccp_opts[] = {
|
|
|
|
{
|
|
|
|
CI_CCP_STAC,
|
|
|
|
"Stac Electronics LZS",
|
|
|
|
&ett_ccp_stac_opt,
|
|
|
|
VARIABLE_LENGTH,
|
|
|
|
5,
|
|
|
|
/* In RFC 1974, this is a fixed-length field of size 5,
|
|
|
|
but in Ascend Proprietary STAC compression this field
|
|
|
|
is 6 octets. Sigh... */
|
|
|
|
dissect_ccp_stac_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_CCP_MPPC,
|
|
|
|
"Microsoft PPC",
|
|
|
|
&ett_ccp_mppc_opt,
|
|
|
|
FIXED_LENGTH,
|
|
|
|
6,
|
|
|
|
dissect_ccp_mppc_opt
|
|
|
|
},
|
2002-01-11 21:37:10 +00:00
|
|
|
{
|
|
|
|
CI_CCP_BSDLZW,
|
|
|
|
"BSD Compress",
|
|
|
|
&ett_ccp_bsdcomp_opt,
|
|
|
|
FIXED_LENGTH,
|
|
|
|
3,
|
|
|
|
dissect_ccp_bsdcomp_opt
|
|
|
|
},
|
2001-10-29 19:48:45 +00:00
|
|
|
{
|
|
|
|
CI_CCP_LZSDCP,
|
|
|
|
"LZS-DCP",
|
|
|
|
&ett_ccp_lzsdcp_opt,
|
|
|
|
FIXED_LENGTH,
|
|
|
|
6,
|
|
|
|
dissect_ccp_lzsdcp_opt
|
2002-01-11 21:37:10 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_CCP_MVRCA,
|
|
|
|
"MVRCA (Magnalink)",
|
|
|
|
&ett_ccp_mvrca_opt,
|
|
|
|
FIXED_LENGTH,
|
|
|
|
4,
|
|
|
|
dissect_ccp_mvrca_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_CCP_DEFLATE,
|
|
|
|
"Deflate",
|
|
|
|
&ett_ccp_deflate_opt,
|
|
|
|
FIXED_LENGTH,
|
|
|
|
4, /* RFC1979 says the length is 3 but it's actually 4. */
|
|
|
|
dissect_ccp_deflate_opt
|
|
|
|
},
|
2001-10-29 19:48:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define N_CCP_OPTS (sizeof ccp_opts / sizeof ccp_opts[0])
|
|
|
|
|
2001-11-04 04:50:12 +00:00
|
|
|
/*
|
|
|
|
* Options. (CBCP)
|
|
|
|
*/
|
|
|
|
#define CI_CBCP_NO_CALLBACK 1 /* No callback */
|
|
|
|
#define CI_CBCP_CB_USER 2 /* Callback to a user-specified number */
|
2002-08-28 21:04:11 +00:00
|
|
|
#define CI_CBCP_CB_PRE 3 /* Callback to a pre-specified or
|
2001-11-04 04:50:12 +00:00
|
|
|
administrator specified number */
|
|
|
|
#define CI_CBCP_CB_ANY 4 /* Callback to any of a list of numbers */
|
|
|
|
|
|
|
|
static void dissect_cbcp_no_callback_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2001-12-10 00:26:21 +00:00
|
|
|
int offset, guint length, packet_info *pinfo,
|
2001-11-04 04:50:12 +00:00
|
|
|
proto_tree *tree);
|
|
|
|
|
|
|
|
static void dissect_cbcp_callback_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2001-12-10 00:26:21 +00:00
|
|
|
int offset, guint length, packet_info *pinfo,
|
2001-11-04 04:50:12 +00:00
|
|
|
proto_tree *tree);
|
|
|
|
|
|
|
|
static const ip_tcp_opt cbcp_opts[] = {
|
|
|
|
{
|
|
|
|
CI_CBCP_NO_CALLBACK,
|
|
|
|
"No callback",
|
2002-04-01 00:51:43 +00:00
|
|
|
NULL,
|
2001-11-04 04:50:12 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
2,
|
|
|
|
dissect_cbcp_no_callback_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_CBCP_CB_USER,
|
|
|
|
"Callback to a user-specified number",
|
|
|
|
&ett_cbcp_callback_opt,
|
|
|
|
VARIABLE_LENGTH,
|
|
|
|
4,
|
|
|
|
dissect_cbcp_callback_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_CBCP_CB_PRE,
|
|
|
|
"Callback to a pre-specified or admin-specified number",
|
|
|
|
&ett_cbcp_callback_opt,
|
|
|
|
FIXED_LENGTH,
|
|
|
|
3,
|
|
|
|
dissect_cbcp_callback_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_CBCP_CB_ANY,
|
|
|
|
"Callback to any of a list of numbers",
|
|
|
|
&ett_cbcp_callback_opt,
|
|
|
|
VARIABLE_LENGTH,
|
|
|
|
4,
|
|
|
|
dissect_cbcp_callback_opt
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#define N_CBCP_OPTS (sizeof cbcp_opts / sizeof cbcp_opts[0])
|
|
|
|
|
2001-12-08 01:03:19 +00:00
|
|
|
/*
|
|
|
|
* Options. (BACP)
|
|
|
|
*/
|
|
|
|
#define CI_BACP_FAVORED_PEER 1 /* Favored-Peer */
|
|
|
|
|
|
|
|
static void dissect_bacp_favored_peer_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2001-12-10 00:26:21 +00:00
|
|
|
int offset, guint length, packet_info *pinfo,
|
2001-12-08 01:03:19 +00:00
|
|
|
proto_tree *tree);
|
|
|
|
|
|
|
|
static const ip_tcp_opt bacp_opts[] = {
|
|
|
|
{
|
|
|
|
CI_BACP_FAVORED_PEER,
|
|
|
|
"Favored-Peer",
|
|
|
|
&ett_bacp_favored_peer_opt,
|
|
|
|
FIXED_LENGTH,
|
|
|
|
6,
|
|
|
|
dissect_bacp_favored_peer_opt
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#define N_BACP_OPTS (sizeof bacp_opts / sizeof bacp_opts[0])
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Options. (BAP)
|
|
|
|
*/
|
|
|
|
#define CI_BAP_LINK_TYPE 1 /* Link Type */
|
|
|
|
#define CI_BAP_PHONE_DELTA 2 /* Phone-Delta */
|
|
|
|
#define CI_BAP_NO_PHONE_NUM_NEEDED 3 /* No Phone Number Needed */
|
|
|
|
#define CI_BAP_REASON 4 /* Reason */
|
|
|
|
#define CI_BAP_LINK_DISC 5 /* Link Discriminator */
|
|
|
|
#define CI_BAP_CALL_STATUS 6 /* Call Status */
|
|
|
|
|
|
|
|
static void dissect_bap_link_type_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2001-12-10 00:26:21 +00:00
|
|
|
int offset, guint length, packet_info *pinfo,
|
2001-12-08 01:03:19 +00:00
|
|
|
proto_tree *tree);
|
|
|
|
|
|
|
|
static void dissect_bap_phone_delta_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2001-12-10 00:26:21 +00:00
|
|
|
int offset, guint length, packet_info *pinfo,
|
2001-12-08 01:03:19 +00:00
|
|
|
proto_tree *tree);
|
|
|
|
|
|
|
|
static void dissect_bap_link_disc_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2001-12-10 00:26:21 +00:00
|
|
|
int offset, guint length, packet_info *pinfo,
|
2001-12-08 01:03:19 +00:00
|
|
|
proto_tree *tree);
|
|
|
|
|
|
|
|
static void dissect_bap_reason_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2001-12-10 00:26:21 +00:00
|
|
|
int offset, guint length, packet_info *pinfo,
|
2001-12-08 01:03:19 +00:00
|
|
|
proto_tree *tree);
|
|
|
|
|
|
|
|
static void dissect_bap_call_status_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2001-12-10 00:26:21 +00:00
|
|
|
int offset, guint length, packet_info *pinfo,
|
2001-12-08 01:03:19 +00:00
|
|
|
proto_tree *tree);
|
|
|
|
|
|
|
|
static const ip_tcp_opt bap_opts[] = {
|
|
|
|
{
|
|
|
|
CI_BAP_LINK_TYPE,
|
|
|
|
"Link Type",
|
|
|
|
&ett_bap_link_type_opt,
|
|
|
|
FIXED_LENGTH,
|
|
|
|
5,
|
|
|
|
dissect_bap_link_type_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_BAP_PHONE_DELTA,
|
|
|
|
"Phone Delta",
|
|
|
|
&ett_bap_phone_delta_opt,
|
|
|
|
VARIABLE_LENGTH,
|
|
|
|
4,
|
|
|
|
dissect_bap_phone_delta_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_BAP_NO_PHONE_NUM_NEEDED,
|
|
|
|
"No Phone Number Needed",
|
|
|
|
NULL,
|
|
|
|
FIXED_LENGTH,
|
|
|
|
2,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_BAP_REASON,
|
|
|
|
"Reason",
|
2002-04-01 00:51:43 +00:00
|
|
|
NULL,
|
2001-12-08 01:03:19 +00:00
|
|
|
VARIABLE_LENGTH,
|
|
|
|
2,
|
|
|
|
dissect_bap_reason_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_BAP_LINK_DISC,
|
|
|
|
"Link Discriminator",
|
2002-04-01 00:51:43 +00:00
|
|
|
NULL,
|
2001-12-08 01:03:19 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
4,
|
|
|
|
dissect_bap_link_disc_opt
|
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_BAP_CALL_STATUS,
|
|
|
|
"Call Status",
|
|
|
|
&ett_bap_call_status_opt,
|
|
|
|
FIXED_LENGTH,
|
|
|
|
4,
|
|
|
|
dissect_bap_call_status_opt
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#define N_BAP_OPTS (sizeof bap_opts / sizeof bap_opts[0])
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
static void dissect_ppp(tvbuff_t *tvb, packet_info *pinfo,
|
2001-03-29 09:18:34 +00:00
|
|
|
proto_tree *tree);
|
|
|
|
|
2001-06-15 20:35:08 +00:00
|
|
|
static const value_string pap_vals[] = {
|
|
|
|
{CONFREQ, "Authenticate-Request" },
|
|
|
|
{CONFACK, "Authenticate-Ack" },
|
|
|
|
{CONFNAK, "Authenticate-Nak" },
|
|
|
|
{0, NULL } };
|
|
|
|
|
|
|
|
static void dissect_pap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
|
|
|
|
|
2001-09-30 13:30:51 +00:00
|
|
|
#define CHAP_CHAL 1 /* CHAP Challenge */
|
|
|
|
#define CHAP_RESP 2 /* CHAP Response */
|
|
|
|
#define CHAP_SUCC 3 /* CHAP Success */
|
|
|
|
#define CHAP_FAIL 4 /* CHAP Failure */
|
|
|
|
|
|
|
|
static const value_string chap_vals[] = {
|
|
|
|
{CHAP_CHAL, "Challenge" },
|
|
|
|
{CHAP_RESP, "Response" },
|
|
|
|
{CHAP_SUCC, "Success" },
|
|
|
|
{CHAP_FAIL, "Failure" },
|
|
|
|
{0, NULL } };
|
|
|
|
|
|
|
|
static void dissect_chap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
|
2001-06-15 20:35:08 +00:00
|
|
|
|
2002-01-03 20:30:33 +00:00
|
|
|
static const value_string pppmuxcp_vals[] = {
|
|
|
|
{CONFREQ, "Configuration Request" },
|
|
|
|
{CONFACK, "Configuration Ack" },
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* PPPMuxCP options
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define CI_DEFAULT_PID 1
|
|
|
|
|
|
|
|
static void dissect_pppmuxcp_def_pid_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
|
|
|
int offset, guint length, packet_info *pinfo, proto_tree *tree);
|
|
|
|
|
|
|
|
|
|
|
|
static const ip_tcp_opt pppmuxcp_opts[] = {
|
|
|
|
{
|
|
|
|
CI_DEFAULT_PID,
|
|
|
|
"Default Protocol ID",
|
2002-04-01 00:51:43 +00:00
|
|
|
NULL,
|
2002-01-03 20:30:33 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
4,
|
|
|
|
dissect_pppmuxcp_def_pid_opt
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#define N_PPPMUXCP_OPTS (sizeof pppmuxcp_opts / sizeof pppmuxcp_opts[0])
|
|
|
|
|
2002-10-14 23:23:20 +00:00
|
|
|
/*
|
|
|
|
* Options. (IPv6CP)
|
|
|
|
*/
|
2003-02-07 20:09:33 +00:00
|
|
|
#define CI_IPV6CP_IF_ID 1 /* Interface Identifier (RFC 2472) */
|
2002-10-14 23:23:20 +00:00
|
|
|
#define CI_IPV6CP_COMPRESSTYPE 2 /* Compression Type (RFC 2472) */
|
|
|
|
|
2003-02-07 20:09:33 +00:00
|
|
|
static void dissect_ipv6cp_if_id_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-10-14 23:23:20 +00:00
|
|
|
int offset, guint length, packet_info *pinfo,
|
|
|
|
proto_tree *tree);
|
|
|
|
|
|
|
|
static const ip_tcp_opt ipv6cp_opts[] = {
|
|
|
|
{
|
2003-02-07 20:09:33 +00:00
|
|
|
CI_IPV6CP_IF_ID,
|
|
|
|
"Interface Identifier",
|
|
|
|
&ett_ipv6cp_if_id_opt,
|
2002-10-14 23:23:20 +00:00
|
|
|
FIXED_LENGTH,
|
|
|
|
10,
|
2003-02-07 20:09:33 +00:00
|
|
|
dissect_ipv6cp_if_id_opt
|
2002-10-14 23:23:20 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
CI_COMPRESSTYPE,
|
2004-11-12 10:17:13 +00:00
|
|
|
"IPv6 compression",
|
2004-11-22 02:12:43 +00:00
|
|
|
&ett_ipcp_compress_opt,
|
2002-10-14 23:23:20 +00:00
|
|
|
VARIABLE_LENGTH,
|
|
|
|
4,
|
2004-11-12 10:17:13 +00:00
|
|
|
dissect_ipcp_compress_opt
|
2002-10-14 23:23:20 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
#define N_IPV6CP_OPTS (sizeof ipv6cp_opts / sizeof ipv6cp_opts[0])
|
|
|
|
|
2000-12-14 08:20:31 +00:00
|
|
|
/*
|
|
|
|
*******************************************************************************
|
|
|
|
* DETAILS : Calculate a new FCS-16 given the current FCS-16 and the new data.
|
|
|
|
*******************************************************************************
|
|
|
|
*/
|
2002-04-14 23:04:04 +00:00
|
|
|
static guint16
|
2004-06-26 09:48:12 +00:00
|
|
|
fcs16(tvbuff_t * tvbuff)
|
2000-12-14 08:20:31 +00:00
|
|
|
{
|
2002-08-04 08:44:31 +00:00
|
|
|
guint len = tvb_length(tvbuff)-2;
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
|
2000-12-14 08:20:31 +00:00
|
|
|
/* Check for Invalid Length */
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
if (len == 0)
|
|
|
|
return (0x0000);
|
2004-06-26 09:48:12 +00:00
|
|
|
return crc16_ccitt_tvb(tvbuff, len);
|
2000-12-14 08:20:31 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-12-14 08:20:31 +00:00
|
|
|
/*
|
|
|
|
*******************************************************************************
|
|
|
|
* DETAILS : Calculate a new FCS-32 given the current FCS-32 and the new data.
|
|
|
|
*******************************************************************************
|
|
|
|
*/
|
2002-04-14 23:04:04 +00:00
|
|
|
static guint32
|
2003-08-26 05:52:53 +00:00
|
|
|
fcs32(tvbuff_t * tvbuff)
|
2000-12-14 08:20:31 +00:00
|
|
|
{
|
2002-08-04 08:44:31 +00:00
|
|
|
guint len = tvb_length(tvbuff)-4;
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
|
2000-12-14 08:20:31 +00:00
|
|
|
/* Check for invalid Length */
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
if (len == 0)
|
|
|
|
return (0x00000000);
|
2004-06-26 09:48:12 +00:00
|
|
|
return crc32_ccitt_tvb(tvbuff, len);
|
2003-08-26 05:52:53 +00:00
|
|
|
}
|
2000-12-14 08:20:31 +00:00
|
|
|
|
2003-08-26 05:52:53 +00:00
|
|
|
tvbuff_t *
|
|
|
|
decode_fcs(tvbuff_t *tvb, proto_tree *fh_tree, int fcs_decode, int proto_offset)
|
|
|
|
{
|
|
|
|
tvbuff_t *next_tvb;
|
|
|
|
gint len, reported_len;
|
|
|
|
int rx_fcs_offset;
|
|
|
|
guint32 rx_fcs_exp;
|
|
|
|
guint32 rx_fcs_got;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Remove the FCS, if any, from the packet data.
|
|
|
|
*/
|
|
|
|
switch (fcs_decode) {
|
|
|
|
|
|
|
|
case NO_FCS:
|
|
|
|
next_tvb = tvb_new_subset(tvb, proto_offset, -1, -1);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FCS_16:
|
|
|
|
/*
|
|
|
|
* Do we have the entire packet, and does it include a 2-byte FCS?
|
|
|
|
*/
|
|
|
|
len = tvb_length_remaining(tvb, proto_offset);
|
|
|
|
reported_len = tvb_reported_length_remaining(tvb, proto_offset);
|
|
|
|
if (reported_len < 2 || len < 0) {
|
|
|
|
/*
|
|
|
|
* The packet is claimed not to even have enough data for a 2-byte FCS,
|
|
|
|
* or we're already past the end of the captured data.
|
|
|
|
* Don't slice anything off.
|
|
|
|
*/
|
|
|
|
next_tvb = tvb_new_subset(tvb, proto_offset, -1, -1);
|
|
|
|
} else if (len < reported_len) {
|
|
|
|
/*
|
|
|
|
* The packet is claimed to have enough data for a 2-byte FCS, but
|
|
|
|
* we didn't capture all of the packet.
|
|
|
|
* Slice off the 2-byte FCS from the reported length, and trim the
|
|
|
|
* captured length so it's no more than the reported length; that
|
|
|
|
* will slice off what of the FCS, if any, is in the captured
|
|
|
|
* length.
|
|
|
|
*/
|
|
|
|
reported_len -= 2;
|
|
|
|
if (len > reported_len)
|
|
|
|
len = reported_len;
|
|
|
|
next_tvb = tvb_new_subset(tvb, proto_offset, len, reported_len);
|
|
|
|
} else {
|
|
|
|
/*
|
|
|
|
* We have the entire packet, and it includes a 2-byte FCS.
|
|
|
|
* Slice it off.
|
|
|
|
*/
|
|
|
|
len -= 2;
|
|
|
|
reported_len -= 2;
|
|
|
|
next_tvb = tvb_new_subset(tvb, proto_offset, len, reported_len);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Compute the FCS and put it into the tree.
|
|
|
|
*/
|
|
|
|
rx_fcs_offset = proto_offset + len;
|
2004-06-26 09:48:12 +00:00
|
|
|
rx_fcs_exp = fcs16(tvb);
|
2003-08-26 05:52:53 +00:00
|
|
|
rx_fcs_got = tvb_get_letohs(tvb, rx_fcs_offset);
|
|
|
|
if (rx_fcs_got != rx_fcs_exp) {
|
|
|
|
proto_tree_add_text(fh_tree, tvb, rx_fcs_offset, 2,
|
|
|
|
"FCS 16: 0x%04x (incorrect, should be 0x%04x)",
|
|
|
|
rx_fcs_got, rx_fcs_exp);
|
|
|
|
} else {
|
|
|
|
proto_tree_add_text(fh_tree, tvb, rx_fcs_offset, 2,
|
|
|
|
"FCS 16: 0x%04x (correct)",
|
|
|
|
rx_fcs_got);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FCS_32:
|
|
|
|
/*
|
|
|
|
* Do we have the entire packet, and does it include a 4-byte FCS?
|
|
|
|
*/
|
|
|
|
len = tvb_length_remaining(tvb, proto_offset);
|
|
|
|
reported_len = tvb_reported_length_remaining(tvb, proto_offset);
|
|
|
|
if (reported_len < 4) {
|
|
|
|
/*
|
|
|
|
* The packet is claimed not to even have enough data for a 4-byte FCS.
|
|
|
|
* Just pass on the tvbuff as is.
|
|
|
|
*/
|
|
|
|
next_tvb = tvb_new_subset(tvb, proto_offset, -1, -1);
|
|
|
|
} else if (len < reported_len) {
|
|
|
|
/*
|
|
|
|
* The packet is claimed to have enough data for a 4-byte FCS, but
|
|
|
|
* we didn't capture all of the packet.
|
|
|
|
* Slice off the 4-byte FCS from the reported length, and trim the
|
|
|
|
* captured length so it's no more than the reported length; that
|
|
|
|
* will slice off what of the FCS, if any, is in the captured
|
|
|
|
* length.
|
|
|
|
*/
|
|
|
|
reported_len -= 4;
|
|
|
|
if (len > reported_len)
|
|
|
|
len = reported_len;
|
|
|
|
next_tvb = tvb_new_subset(tvb, proto_offset, len, reported_len);
|
|
|
|
} else {
|
|
|
|
/*
|
|
|
|
* We have the entire packet, and it includes a 4-byte FCS.
|
|
|
|
* Slice it off.
|
|
|
|
*/
|
|
|
|
len -= 4;
|
|
|
|
reported_len -= 4;
|
|
|
|
next_tvb = tvb_new_subset(tvb, proto_offset, len, reported_len);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Compute the FCS and put it into the tree.
|
|
|
|
*/
|
|
|
|
rx_fcs_offset = proto_offset + len;
|
|
|
|
rx_fcs_exp = fcs32(tvb);
|
|
|
|
rx_fcs_got = tvb_get_letohl(tvb, rx_fcs_offset);
|
|
|
|
if (rx_fcs_got != rx_fcs_exp) {
|
|
|
|
proto_tree_add_text(fh_tree, tvb, rx_fcs_offset, 4,
|
|
|
|
"FCS 32: 0x%08x (incorrect, should be 0x%08x)",
|
|
|
|
rx_fcs_got, rx_fcs_exp);
|
|
|
|
} else {
|
|
|
|
proto_tree_add_text(fh_tree, tvb, rx_fcs_offset, 4,
|
|
|
|
"FCS 32: 0x%08x (correct)",
|
|
|
|
rx_fcs_got);
|
|
|
|
}
|
2001-01-10 09:07:35 +00:00
|
|
|
}
|
2003-08-26 05:52:53 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
g_assert_not_reached();
|
|
|
|
next_tvb = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return next_tvb;
|
2000-12-14 08:20:31 +00:00
|
|
|
}
|
|
|
|
|
1999-02-09 00:35:38 +00:00
|
|
|
void
|
2002-08-02 23:36:07 +00:00
|
|
|
capture_ppp_hdlc( const guchar *pd, int offset, int len, packet_counts *ld ) {
|
2001-11-20 21:59:18 +00:00
|
|
|
if (!BYTES_ARE_IN_FRAME(offset, len, 2)) {
|
|
|
|
ld->other++;
|
|
|
|
return;
|
|
|
|
}
|
Add a new Wiretap encapsulation type for Cisco HDLC. Map the NetBSD
DLT_HDLC to it.
Make a separate dissector for Cisco HDLC, and add a dissector for Cisco
SLARP. Have the PPP dissector call the Cisco HDLC dissector if the
address field is the Cisco HDLC unicast or multicast address. Use the
Cisco HDLC dissector for the Cisco HDLC Wiretap encapsulation type.
Add a new dissector table "chdlctype", for Cisco HDLC packet types
(they're *almost* the same as Ethernet types, but 0x8035 is SLARP, not
Reverse ARP, and 0x2000 is the Cisco Discovery protocol, for example),
replacing "fr.chdlc".
Have a "chdlctype()" routine, similar to "ethertype()", used both by the
Cisco HDLC and Frame Relay dissectors. Have a "chdlc_vals[]"
"value_string" table for Cisco HDLC types and protocol names. Split the
packet type field in the Frame Relay dissector into separate SNAP and
Cisco HDLC fields, and give them the Ethernet type and Cisco HDLC type
"value_string" tables, respectively.
svn path=/trunk/; revision=3133
2001-03-15 09:11:03 +00:00
|
|
|
if (pd[0] == CHDLC_ADDR_UNICAST || pd[0] == CHDLC_ADDR_MULTICAST) {
|
2001-11-20 21:59:18 +00:00
|
|
|
capture_chdlc(pd, offset, len, ld);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!BYTES_ARE_IN_FRAME(offset, len, 4)) {
|
|
|
|
ld->other++;
|
Add a new Wiretap encapsulation type for Cisco HDLC. Map the NetBSD
DLT_HDLC to it.
Make a separate dissector for Cisco HDLC, and add a dissector for Cisco
SLARP. Have the PPP dissector call the Cisco HDLC dissector if the
address field is the Cisco HDLC unicast or multicast address. Use the
Cisco HDLC dissector for the Cisco HDLC Wiretap encapsulation type.
Add a new dissector table "chdlctype", for Cisco HDLC packet types
(they're *almost* the same as Ethernet types, but 0x8035 is SLARP, not
Reverse ARP, and 0x2000 is the Cisco Discovery protocol, for example),
replacing "fr.chdlc".
Have a "chdlctype()" routine, similar to "ethertype()", used both by the
Cisco HDLC and Frame Relay dissectors. Have a "chdlc_vals[]"
"value_string" table for Cisco HDLC types and protocol names. Split the
packet type field in the Frame Relay dissector into separate SNAP and
Cisco HDLC fields, and give them the Ethernet type and Cisco HDLC type
"value_string" tables, respectively.
svn path=/trunk/; revision=3133
2001-03-15 09:11:03 +00:00
|
|
|
return;
|
|
|
|
}
|
2000-05-25 07:42:26 +00:00
|
|
|
switch (pntohs(&pd[offset + 2])) {
|
1999-02-09 00:35:38 +00:00
|
|
|
case PPP_IP:
|
2001-11-20 21:59:18 +00:00
|
|
|
capture_ip(pd, offset + 4, len, ld);
|
1999-02-09 00:35:38 +00:00
|
|
|
break;
|
1999-11-30 23:56:37 +00:00
|
|
|
case PPP_IPX:
|
2002-04-24 06:03:34 +00:00
|
|
|
capture_ipx(ld);
|
1999-11-30 23:56:37 +00:00
|
|
|
break;
|
2000-01-20 21:34:16 +00:00
|
|
|
case PPP_VINES:
|
2002-04-24 06:03:34 +00:00
|
|
|
capture_vines(ld);
|
2000-01-20 21:34:16 +00:00
|
|
|
break;
|
1999-02-09 00:35:38 +00:00
|
|
|
default:
|
|
|
|
ld->other++;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-08-25 06:52:04 +00:00
|
|
|
static void
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
dissect_lcp_mru_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset,
|
2002-03-31 22:37:09 +00:00
|
|
|
guint length, packet_info *pinfo _U_,
|
|
|
|
proto_tree *tree)
|
1999-08-25 06:52:04 +00:00
|
|
|
{
|
2002-03-31 22:37:09 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset, length, "%s: %u", optp->name,
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
tvb_get_ntohs(tvb, offset + 2));
|
1999-08-25 06:52:04 +00:00
|
|
|
}
|
1999-06-11 15:30:55 +00:00
|
|
|
|
1999-08-25 07:32:46 +00:00
|
|
|
static void
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
dissect_lcp_async_map_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset,
|
2002-03-31 22:37:09 +00:00
|
|
|
guint length, packet_info *pinfo _U_,
|
|
|
|
proto_tree *tree)
|
1999-08-25 07:32:46 +00:00
|
|
|
{
|
2002-04-01 00:51:43 +00:00
|
|
|
guint32 map;
|
|
|
|
char *mapstr;
|
|
|
|
static const char *ctrlchars[32] = {
|
|
|
|
"NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
|
|
|
|
"BS", "HT", "NL", "VT", "NP (FF)", "CR", "SO", "SI",
|
|
|
|
"DLE", "DC1 (XON)", "DC2", "DC3 (XOFF)", "DC4", "NAK", "SYN", "ETB",
|
|
|
|
"CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US"
|
|
|
|
};
|
|
|
|
char mapbuf[32*(10+2)+1];
|
|
|
|
char *mapp;
|
|
|
|
int i;
|
|
|
|
|
2002-03-31 22:37:09 +00:00
|
|
|
/*
|
|
|
|
* XXX - walk through the map and show the characters to map?
|
|
|
|
* Put them in a subtree of this item, and have the top-level item
|
|
|
|
* either say "None", "All", or give a list of the characters?)
|
|
|
|
*/
|
2002-04-01 00:51:43 +00:00
|
|
|
map = tvb_get_ntohl(tvb, offset + 2);
|
|
|
|
if (map == 0x00000000)
|
|
|
|
mapstr = "None"; /* don't map any control characters */
|
|
|
|
else if (map == 0xffffffff)
|
|
|
|
mapstr = "All"; /* map all control characters */
|
|
|
|
else {
|
|
|
|
/*
|
|
|
|
* Show the names of the control characters being mapped.
|
|
|
|
*/
|
|
|
|
mapp = &mapbuf[0];
|
|
|
|
for (i = 0; i < 32; i++) {
|
|
|
|
if (map & (1 << i)) {
|
|
|
|
if (mapp != &mapbuf[0]) {
|
|
|
|
strcpy(mapp, ", ");
|
|
|
|
mapp += 2;
|
|
|
|
}
|
|
|
|
strcpy(mapp, ctrlchars[i]);
|
|
|
|
mapp += strlen(ctrlchars[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
mapstr = mapbuf;
|
|
|
|
}
|
|
|
|
proto_tree_add_text(tree, tvb, offset, length, "%s: 0x%08x (%s)", optp->name,
|
|
|
|
map, mapstr);
|
1999-08-25 07:32:46 +00:00
|
|
|
}
|
|
|
|
|
1999-08-25 06:52:04 +00:00
|
|
|
static void
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
dissect_lcp_protocol_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset,
|
2002-03-31 22:37:09 +00:00
|
|
|
guint length, packet_info *pinfo _U_,
|
|
|
|
proto_tree *tree)
|
1999-08-25 06:52:04 +00:00
|
|
|
{
|
|
|
|
guint16 protocol;
|
|
|
|
proto_item *tf;
|
|
|
|
proto_tree *field_tree = NULL;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length, "%s: %u byte%s",
|
1999-08-25 07:32:46 +00:00
|
|
|
optp->name, length, plurality(length, "", "s"));
|
1999-11-16 11:44:20 +00:00
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
1999-08-25 06:52:04 +00:00
|
|
|
offset += 2;
|
|
|
|
length -= 2;
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
protocol = tvb_get_ntohs(tvb, offset);
|
|
|
|
proto_tree_add_text(field_tree, tvb, offset, 2, "%s: %s (0x%02x)", optp->name,
|
1999-08-25 06:52:04 +00:00
|
|
|
val_to_str(protocol, ppp_vals, "Unknown"), protocol);
|
|
|
|
offset += 2;
|
|
|
|
length -= 2;
|
1999-08-25 07:32:46 +00:00
|
|
|
if (length > 0)
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset, length, "Data (%d byte%s)", length,
|
1999-08-25 07:32:46 +00:00
|
|
|
plurality(length, "", "s"));
|
1999-08-25 06:52:04 +00:00
|
|
|
}
|
1999-06-11 15:30:55 +00:00
|
|
|
|
2001-08-05 19:44:13 +00:00
|
|
|
static void
|
|
|
|
dissect_lcp_authprot_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset,
|
2002-03-31 22:37:09 +00:00
|
|
|
guint length, packet_info *pinfo _U_,
|
|
|
|
proto_tree *tree)
|
2001-08-05 19:44:13 +00:00
|
|
|
{
|
|
|
|
guint16 protocol;
|
|
|
|
guint8 algorithm;
|
|
|
|
proto_item *tf;
|
|
|
|
proto_tree *field_tree = NULL;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-08-05 19:44:13 +00:00
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length, "%s: %u byte%s",
|
|
|
|
optp->name, length, plurality(length, "", "s"));
|
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
|
|
|
offset += 2;
|
|
|
|
length -= 2;
|
|
|
|
protocol = tvb_get_ntohs(tvb, offset);
|
|
|
|
proto_tree_add_text(field_tree, tvb, offset, 2, "%s: %s (0x%02x)", optp->name,
|
|
|
|
val_to_str(protocol, ppp_vals, "Unknown"), protocol);
|
|
|
|
offset += 2;
|
|
|
|
length -= 2;
|
|
|
|
if (length > 0) {
|
|
|
|
if (protocol == PPP_CHAP) {
|
|
|
|
algorithm = tvb_get_guint8(tvb, offset);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset, length,
|
|
|
|
"Algorithm: %s (0x%02x)",
|
|
|
|
val_to_str(algorithm, chap_alg_vals, "Unknown"),
|
2001-08-05 19:44:13 +00:00
|
|
|
algorithm);
|
|
|
|
offset++;
|
|
|
|
} else {
|
|
|
|
proto_tree_add_text(field_tree, tvb, offset, length, "Data (%d byte%s)", length,
|
|
|
|
plurality(length, "", "s"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-08-25 06:52:04 +00:00
|
|
|
static void
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
dissect_lcp_magicnumber_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
Add a "col_clear()" routine, to clear a column; it appears (and it
doesn't just seem to be a profiling artifact) that, at least on FreeBSD
3.4, it's significantly more efficient to clear out a column by stuffing
a '\0' into the first byte of the column data than to do so by copying a
null string (I guess when copying one byte, the fixed overhead of the
procedure call and of "strcpy()" is significant).
Have the TCP dissector set the Protocol column, and clear the Info
column, before doing anything that might cause an exception to be
thrown, so that if we *do* get an exception thrown, the frame at least
shows up as TCP.
Instead of, in the TCP dissector, constructing a string and then
stuffing it into the Info column, just append to the Info column, which
avoids one string copy.
Pass a "frame_data" pointer to dissectors for TCP and IP (and PPP)
options, so they can use it to append to the Info column.
svn path=/trunk/; revision=2744
2000-12-04 06:37:46 +00:00
|
|
|
proto_tree *tree)
|
1999-08-25 06:52:04 +00:00
|
|
|
{
|
2002-03-31 22:37:09 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset, length, "%s: 0x%08x", optp->name,
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
tvb_get_ntohl(tvb, offset + 2));
|
1999-08-25 06:52:04 +00:00
|
|
|
}
|
1999-06-11 15:30:55 +00:00
|
|
|
|
1999-08-28 08:31:28 +00:00
|
|
|
static void
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
dissect_lcp_fcs_alternatives_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
Add a "col_clear()" routine, to clear a column; it appears (and it
doesn't just seem to be a profiling artifact) that, at least on FreeBSD
3.4, it's significantly more efficient to clear out a column by stuffing
a '\0' into the first byte of the column data than to do so by copying a
null string (I guess when copying one byte, the fixed overhead of the
procedure call and of "strcpy()" is significant).
Have the TCP dissector set the Protocol column, and clear the Info
column, before doing anything that might cause an exception to be
thrown, so that if we *do* get an exception thrown, the frame at least
shows up as TCP.
Instead of, in the TCP dissector, constructing a string and then
stuffing it into the Info column, just append to the Info column, which
avoids one string copy.
Pass a "frame_data" pointer to dissectors for TCP and IP (and PPP)
options, so they can use it to append to the Info column.
svn path=/trunk/; revision=2744
2000-12-04 06:37:46 +00:00
|
|
|
proto_tree *tree)
|
1999-08-25 06:52:04 +00:00
|
|
|
{
|
1999-08-28 08:31:28 +00:00
|
|
|
proto_item *tf;
|
|
|
|
proto_tree *field_tree = NULL;
|
|
|
|
guint8 alternatives;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
alternatives = tvb_get_guint8(tvb, offset + 2);
|
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length, "%s: 0x%02x",
|
1999-08-28 08:31:28 +00:00
|
|
|
optp->name, alternatives);
|
1999-11-16 11:44:20 +00:00
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
1999-08-28 08:31:28 +00:00
|
|
|
offset += 2;
|
|
|
|
if (alternatives & 0x1)
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 2, 1, "%s",
|
1999-08-28 08:31:28 +00:00
|
|
|
decode_boolean_bitfield(alternatives, 0x1, 8, "Null FCS", NULL));
|
|
|
|
if (alternatives & 0x2)
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 2, 1, "%s",
|
1999-08-28 08:31:28 +00:00
|
|
|
decode_boolean_bitfield(alternatives, 0x2, 8, "CCITT 16-bit FCS", NULL));
|
|
|
|
if (alternatives & 0x4)
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 2, 1, "%s",
|
1999-08-28 08:31:28 +00:00
|
|
|
decode_boolean_bitfield(alternatives, 0x4, 8, "CCITT 32-bit FCS", NULL));
|
1999-08-25 06:52:04 +00:00
|
|
|
}
|
1999-06-11 15:30:55 +00:00
|
|
|
|
1999-08-25 06:52:04 +00:00
|
|
|
static void
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
dissect_lcp_self_describing_pad_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
Add a "col_clear()" routine, to clear a column; it appears (and it
doesn't just seem to be a profiling artifact) that, at least on FreeBSD
3.4, it's significantly more efficient to clear out a column by stuffing
a '\0' into the first byte of the column data than to do so by copying a
null string (I guess when copying one byte, the fixed overhead of the
procedure call and of "strcpy()" is significant).
Have the TCP dissector set the Protocol column, and clear the Info
column, before doing anything that might cause an exception to be
thrown, so that if we *do* get an exception thrown, the frame at least
shows up as TCP.
Instead of, in the TCP dissector, constructing a string and then
stuffing it into the Info column, just append to the Info column, which
avoids one string copy.
Pass a "frame_data" pointer to dissectors for TCP and IP (and PPP)
options, so they can use it to append to the Info column.
svn path=/trunk/; revision=2744
2000-12-04 06:37:46 +00:00
|
|
|
proto_tree *tree)
|
1999-08-25 06:52:04 +00:00
|
|
|
{
|
2002-03-31 22:37:09 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset, length, "%s: %u", optp->name,
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
tvb_get_guint8(tvb, offset + 2));
|
1999-08-28 08:31:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
dissect_lcp_numbered_mode_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
Add a "col_clear()" routine, to clear a column; it appears (and it
doesn't just seem to be a profiling artifact) that, at least on FreeBSD
3.4, it's significantly more efficient to clear out a column by stuffing
a '\0' into the first byte of the column data than to do so by copying a
null string (I guess when copying one byte, the fixed overhead of the
procedure call and of "strcpy()" is significant).
Have the TCP dissector set the Protocol column, and clear the Info
column, before doing anything that might cause an exception to be
thrown, so that if we *do* get an exception thrown, the frame at least
shows up as TCP.
Instead of, in the TCP dissector, constructing a string and then
stuffing it into the Info column, just append to the Info column, which
avoids one string copy.
Pass a "frame_data" pointer to dissectors for TCP and IP (and PPP)
options, so they can use it to append to the Info column.
svn path=/trunk/; revision=2744
2000-12-04 06:37:46 +00:00
|
|
|
proto_tree *tree)
|
1999-08-28 08:31:28 +00:00
|
|
|
{
|
|
|
|
proto_item *tf;
|
|
|
|
proto_tree *field_tree = NULL;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length, "%s: %u byte%s",
|
1999-08-28 08:31:28 +00:00
|
|
|
optp->name, length, plurality(length, "", "s"));
|
1999-11-16 11:44:20 +00:00
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
1999-08-28 08:31:28 +00:00
|
|
|
offset += 2;
|
|
|
|
length -= 2;
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset, 1, "Window: %u",
|
|
|
|
tvb_get_guint8(tvb, offset));
|
1999-08-28 08:31:28 +00:00
|
|
|
offset += 1;
|
|
|
|
length -= 1;
|
|
|
|
if (length > 0)
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset, length, "Address (%d byte%s)",
|
1999-08-28 08:31:28 +00:00
|
|
|
length, plurality(length, "", "s"));
|
|
|
|
}
|
|
|
|
|
|
|
|
static const value_string callback_op_vals[] = {
|
|
|
|
{0, "Location is determined by user authentication" },
|
|
|
|
{1, "Message is dialing string" },
|
|
|
|
{2, "Message is location identifier" },
|
|
|
|
{3, "Message is E.164" },
|
|
|
|
{4, "Message is distinguished name" },
|
2001-08-05 19:44:13 +00:00
|
|
|
{5, "unassigned"},
|
2001-08-05 10:09:40 +00:00
|
|
|
{6, "Location is determined during CBCP negotiation" },
|
1999-08-28 08:31:28 +00:00
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
dissect_lcp_callback_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset,
|
2002-03-31 22:37:09 +00:00
|
|
|
guint length, packet_info *pinfo _U_,
|
|
|
|
proto_tree *tree)
|
1999-08-28 08:31:28 +00:00
|
|
|
{
|
|
|
|
proto_item *tf;
|
|
|
|
proto_tree *field_tree = NULL;
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
guint8 operation;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length, "%s: %u byte%s",
|
1999-08-28 08:31:28 +00:00
|
|
|
optp->name, length, plurality(length, "", "s"));
|
1999-11-16 11:44:20 +00:00
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
1999-08-28 08:31:28 +00:00
|
|
|
offset += 2;
|
|
|
|
length -= 2;
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
operation = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_text(field_tree, tvb, offset, 1, "Operation: %s (0x%02x)",
|
|
|
|
val_to_str(operation, callback_op_vals, "Unknown"),
|
|
|
|
operation);
|
1999-08-28 08:31:28 +00:00
|
|
|
offset += 1;
|
|
|
|
length -= 1;
|
|
|
|
if (length > 0)
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset, length, "Message (%d byte%s)",
|
1999-08-28 08:31:28 +00:00
|
|
|
length, plurality(length, "", "s"));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
dissect_lcp_multilink_mrru_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
Add a "col_clear()" routine, to clear a column; it appears (and it
doesn't just seem to be a profiling artifact) that, at least on FreeBSD
3.4, it's significantly more efficient to clear out a column by stuffing
a '\0' into the first byte of the column data than to do so by copying a
null string (I guess when copying one byte, the fixed overhead of the
procedure call and of "strcpy()" is significant).
Have the TCP dissector set the Protocol column, and clear the Info
column, before doing anything that might cause an exception to be
thrown, so that if we *do* get an exception thrown, the frame at least
shows up as TCP.
Instead of, in the TCP dissector, constructing a string and then
stuffing it into the Info column, just append to the Info column, which
avoids one string copy.
Pass a "frame_data" pointer to dissectors for TCP and IP (and PPP)
options, so they can use it to append to the Info column.
svn path=/trunk/; revision=2744
2000-12-04 06:37:46 +00:00
|
|
|
proto_tree *tree)
|
1999-08-28 08:31:28 +00:00
|
|
|
{
|
2002-03-31 22:37:09 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset, length, "%s: %u", optp->name,
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
tvb_get_ntohs(tvb, offset + 2));
|
1999-08-28 08:31:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#define CLASS_NULL 0
|
|
|
|
#define CLASS_LOCAL 1
|
|
|
|
#define CLASS_IP 2
|
|
|
|
#define CLASS_IEEE_802_1 3
|
|
|
|
#define CLASS_PPP_MAGIC_NUMBER 4
|
|
|
|
#define CLASS_PSDN_DIRECTORY_NUMBER 5
|
|
|
|
|
|
|
|
static const value_string multilink_ep_disc_class_vals[] = {
|
|
|
|
{CLASS_NULL, "Null" },
|
|
|
|
{CLASS_LOCAL, "Locally assigned address" },
|
|
|
|
{CLASS_IP, "IP address" },
|
|
|
|
{CLASS_IEEE_802_1, "IEEE 802.1 globally assigned MAC address" },
|
|
|
|
{CLASS_PPP_MAGIC_NUMBER, "PPP magic-number block" },
|
|
|
|
{CLASS_PSDN_DIRECTORY_NUMBER, "Public switched network directory number" },
|
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
dissect_lcp_multilink_ep_disc_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
Add a "col_clear()" routine, to clear a column; it appears (and it
doesn't just seem to be a profiling artifact) that, at least on FreeBSD
3.4, it's significantly more efficient to clear out a column by stuffing
a '\0' into the first byte of the column data than to do so by copying a
null string (I guess when copying one byte, the fixed overhead of the
procedure call and of "strcpy()" is significant).
Have the TCP dissector set the Protocol column, and clear the Info
column, before doing anything that might cause an exception to be
thrown, so that if we *do* get an exception thrown, the frame at least
shows up as TCP.
Instead of, in the TCP dissector, constructing a string and then
stuffing it into the Info column, just append to the Info column, which
avoids one string copy.
Pass a "frame_data" pointer to dissectors for TCP and IP (and PPP)
options, so they can use it to append to the Info column.
svn path=/trunk/; revision=2744
2000-12-04 06:37:46 +00:00
|
|
|
proto_tree *tree)
|
1999-08-28 08:31:28 +00:00
|
|
|
{
|
|
|
|
proto_item *tf;
|
|
|
|
proto_tree *field_tree = NULL;
|
|
|
|
guint8 ep_disc_class;
|
|
|
|
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length, "%s: %u byte%s",
|
1999-08-28 08:31:28 +00:00
|
|
|
optp->name, length, plurality(length, "", "s"));
|
1999-11-16 11:44:20 +00:00
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
1999-08-28 08:31:28 +00:00
|
|
|
offset += 2;
|
|
|
|
length -= 2;
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
ep_disc_class = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_text(field_tree, tvb, offset, 1, "Class: %s (%u)",
|
1999-08-28 08:31:28 +00:00
|
|
|
val_to_str(ep_disc_class, multilink_ep_disc_class_vals, "Unknown"),
|
|
|
|
ep_disc_class);
|
|
|
|
offset += 1;
|
|
|
|
length -= 1;
|
|
|
|
if (length > 0) {
|
|
|
|
switch (ep_disc_class) {
|
|
|
|
|
|
|
|
case CLASS_NULL:
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset, length,
|
1999-08-28 08:31:28 +00:00
|
|
|
"Address (%d byte%s), should have been empty",
|
|
|
|
length, plurality(length, "", "s"));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CLASS_LOCAL:
|
|
|
|
if (length > 20) {
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset, length,
|
1999-08-28 08:31:28 +00:00
|
|
|
"Address (%d byte%s), should have been <20",
|
|
|
|
length, plurality(length, "", "s"));
|
1999-08-25 06:52:04 +00:00
|
|
|
} else {
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset, length,
|
1999-08-28 08:31:28 +00:00
|
|
|
"Address (%d byte%s)",
|
|
|
|
length, plurality(length, "", "s"));
|
1999-08-25 06:52:04 +00:00
|
|
|
}
|
1999-08-28 08:31:28 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case CLASS_IP:
|
|
|
|
if (length != 4) {
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset, length,
|
1999-08-28 08:31:28 +00:00
|
|
|
"Address (%d byte%s), should have been 4",
|
|
|
|
length, plurality(length, "", "s"));
|
|
|
|
} else {
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset, length,
|
|
|
|
"Address: %s", ip_to_str(tvb_get_ptr(tvb, offset, 4)));
|
1999-08-28 08:31:28 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CLASS_IEEE_802_1:
|
|
|
|
if (length != 6) {
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset, length,
|
1999-08-28 08:31:28 +00:00
|
|
|
"Address (%d byte%s), should have been 6",
|
|
|
|
length, plurality(length, "", "s"));
|
|
|
|
} else {
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset, length,
|
|
|
|
"Address: %s", ether_to_str(tvb_get_ptr(tvb, offset, 6)));
|
1999-08-28 08:31:28 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CLASS_PPP_MAGIC_NUMBER:
|
|
|
|
/* XXX - dissect as 32-bit magic numbers */
|
|
|
|
if (length > 20) {
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset, length,
|
1999-08-28 08:31:28 +00:00
|
|
|
"Address (%d byte%s), should have been <20",
|
|
|
|
length, plurality(length, "", "s"));
|
|
|
|
} else {
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset, length,
|
1999-08-28 08:31:28 +00:00
|
|
|
"Address (%d byte%s)",
|
|
|
|
length, plurality(length, "", "s"));
|
1999-08-25 06:52:04 +00:00
|
|
|
}
|
1999-08-28 08:31:28 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case CLASS_PSDN_DIRECTORY_NUMBER:
|
|
|
|
if (length > 15) {
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset, length,
|
1999-08-28 08:31:28 +00:00
|
|
|
"Address (%d byte%s), should have been <20",
|
|
|
|
length, plurality(length, "", "s"));
|
|
|
|
} else {
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset, length,
|
1999-08-28 08:31:28 +00:00
|
|
|
"Address (%d byte%s)",
|
|
|
|
length, plurality(length, "", "s"));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset, length,
|
1999-08-28 08:31:28 +00:00
|
|
|
"Address (%d byte%s)",
|
|
|
|
length, plurality(length, "", "s"));
|
|
|
|
break;
|
1999-08-25 06:52:04 +00:00
|
|
|
}
|
1999-06-11 15:30:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-08-28 08:31:28 +00:00
|
|
|
static void
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
dissect_lcp_bap_link_discriminator_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
Add a "col_clear()" routine, to clear a column; it appears (and it
doesn't just seem to be a profiling artifact) that, at least on FreeBSD
3.4, it's significantly more efficient to clear out a column by stuffing
a '\0' into the first byte of the column data than to do so by copying a
null string (I guess when copying one byte, the fixed overhead of the
procedure call and of "strcpy()" is significant).
Have the TCP dissector set the Protocol column, and clear the Info
column, before doing anything that might cause an exception to be
thrown, so that if we *do* get an exception thrown, the frame at least
shows up as TCP.
Instead of, in the TCP dissector, constructing a string and then
stuffing it into the Info column, just append to the Info column, which
avoids one string copy.
Pass a "frame_data" pointer to dissectors for TCP and IP (and PPP)
options, so they can use it to append to the Info column.
svn path=/trunk/; revision=2744
2000-12-04 06:37:46 +00:00
|
|
|
proto_tree *tree)
|
1999-08-28 08:31:28 +00:00
|
|
|
{
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset, length,
|
2002-03-31 22:37:09 +00:00
|
|
|
"%s: 0x%04x", optp->name,
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
tvb_get_ntohs(tvb, offset + 2));
|
1999-08-28 08:31:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Character set numbers from the IANA charset registry. */
|
|
|
|
static const value_string charset_num_vals[] = {
|
|
|
|
{105, "UTF-8" },
|
|
|
|
{0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
dissect_lcp_internationalization_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
Add a "col_clear()" routine, to clear a column; it appears (and it
doesn't just seem to be a profiling artifact) that, at least on FreeBSD
3.4, it's significantly more efficient to clear out a column by stuffing
a '\0' into the first byte of the column data than to do so by copying a
null string (I guess when copying one byte, the fixed overhead of the
procedure call and of "strcpy()" is significant).
Have the TCP dissector set the Protocol column, and clear the Info
column, before doing anything that might cause an exception to be
thrown, so that if we *do* get an exception thrown, the frame at least
shows up as TCP.
Instead of, in the TCP dissector, constructing a string and then
stuffing it into the Info column, just append to the Info column, which
avoids one string copy.
Pass a "frame_data" pointer to dissectors for TCP and IP (and PPP)
options, so they can use it to append to the Info column.
svn path=/trunk/; revision=2744
2000-12-04 06:37:46 +00:00
|
|
|
proto_tree *tree)
|
1999-08-28 08:31:28 +00:00
|
|
|
{
|
|
|
|
proto_item *tf;
|
|
|
|
proto_tree *field_tree = NULL;
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
guint32 charset;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length, "%s: %u byte%s",
|
1999-08-28 08:31:28 +00:00
|
|
|
optp->name, length, plurality(length, "", "s"));
|
1999-11-16 11:44:20 +00:00
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
1999-08-28 08:31:28 +00:00
|
|
|
offset += 2;
|
|
|
|
length -= 2;
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
charset = tvb_get_ntohl(tvb, offset);
|
|
|
|
proto_tree_add_text(field_tree, tvb, offset, 4, "Character set: %s (0x%04x)",
|
|
|
|
val_to_str(charset, charset_num_vals, "Unknown"),
|
|
|
|
charset);
|
1999-08-28 08:31:28 +00:00
|
|
|
offset += 4;
|
|
|
|
length -= 4;
|
|
|
|
if (length > 0) {
|
|
|
|
/* XXX - should be displayed as an ASCII string */
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset, length, "Language tag (%d byte%s)",
|
1999-08-28 08:31:28 +00:00
|
|
|
length, plurality(length, "", "s"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
dissect_ipcp_addrs_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
Add a "col_clear()" routine, to clear a column; it appears (and it
doesn't just seem to be a profiling artifact) that, at least on FreeBSD
3.4, it's significantly more efficient to clear out a column by stuffing
a '\0' into the first byte of the column data than to do so by copying a
null string (I guess when copying one byte, the fixed overhead of the
procedure call and of "strcpy()" is significant).
Have the TCP dissector set the Protocol column, and clear the Info
column, before doing anything that might cause an exception to be
thrown, so that if we *do* get an exception thrown, the frame at least
shows up as TCP.
Instead of, in the TCP dissector, constructing a string and then
stuffing it into the Info column, just append to the Info column, which
avoids one string copy.
Pass a "frame_data" pointer to dissectors for TCP and IP (and PPP)
options, so they can use it to append to the Info column.
svn path=/trunk/; revision=2744
2000-12-04 06:37:46 +00:00
|
|
|
proto_tree *tree)
|
1999-08-28 08:31:28 +00:00
|
|
|
{
|
|
|
|
proto_item *tf;
|
|
|
|
proto_tree *field_tree = NULL;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length, "%s: %u byte%s",
|
1999-08-28 08:31:28 +00:00
|
|
|
optp->name, length, plurality(length, "", "s"));
|
1999-11-16 11:44:20 +00:00
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
1999-08-28 08:31:28 +00:00
|
|
|
offset += 2;
|
|
|
|
length -= 2;
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset, 4,
|
|
|
|
"Source IP address: %s",
|
|
|
|
ip_to_str(tvb_get_ptr(tvb, offset, 4)));
|
1999-08-28 08:31:28 +00:00
|
|
|
offset += 4;
|
|
|
|
length -= 4;
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset, 4,
|
|
|
|
"Destination IP address: %s",
|
|
|
|
ip_to_str(tvb_get_ptr(tvb, offset, 4)));
|
1999-08-28 08:31:28 +00:00
|
|
|
}
|
|
|
|
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
static void dissect_ipcp_addr_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
Add a "col_clear()" routine, to clear a column; it appears (and it
doesn't just seem to be a profiling artifact) that, at least on FreeBSD
3.4, it's significantly more efficient to clear out a column by stuffing
a '\0' into the first byte of the column data than to do so by copying a
null string (I guess when copying one byte, the fixed overhead of the
procedure call and of "strcpy()" is significant).
Have the TCP dissector set the Protocol column, and clear the Info
column, before doing anything that might cause an exception to be
thrown, so that if we *do* get an exception thrown, the frame at least
shows up as TCP.
Instead of, in the TCP dissector, constructing a string and then
stuffing it into the Info column, just append to the Info column, which
avoids one string copy.
Pass a "frame_data" pointer to dissectors for TCP and IP (and PPP)
options, so they can use it to append to the Info column.
svn path=/trunk/; revision=2744
2000-12-04 06:37:46 +00:00
|
|
|
proto_tree *tree)
|
1999-08-28 08:31:28 +00:00
|
|
|
{
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset, length, "%s: %s", optp->name,
|
|
|
|
ip_to_str(tvb_get_ptr(tvb, offset + 2, 4)));
|
1999-08-28 08:31:28 +00:00
|
|
|
}
|
|
|
|
|
2004-11-12 10:17:13 +00:00
|
|
|
static void dissect_ipcp_compress_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
|
|
|
proto_tree *tree)
|
|
|
|
{
|
|
|
|
guint8 ub;
|
|
|
|
guint16 us;
|
|
|
|
proto_item *tf;
|
|
|
|
proto_tree *field_tree = NULL;
|
|
|
|
|
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length, "%s: %u byte%s",
|
|
|
|
optp->name, length, plurality(length, "", "s"));
|
|
|
|
|
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
|
|
|
offset += 2; /* Skip option type + length */
|
|
|
|
length -= 2;
|
|
|
|
|
|
|
|
us = tvb_get_ntohs(tvb, offset);
|
2004-11-22 02:12:43 +00:00
|
|
|
proto_tree_add_text( field_tree, tvb, offset, 2, "IP compression protocol: %s (0x%04x)",
|
2004-11-12 10:17:13 +00:00
|
|
|
val_to_str( us, ipcp_compress_proto_vals, "Unknown protocol" ),
|
|
|
|
us );
|
|
|
|
offset += 2; /* skip protocol */
|
|
|
|
length -= 2;
|
|
|
|
|
|
|
|
if (length > 0) {
|
|
|
|
switch ( us ) {
|
|
|
|
case IPCP_COMPRESS_VJ_1172:
|
|
|
|
case IPCP_COMPRESS_VJ:
|
|
|
|
/* First byte is max slot id */
|
|
|
|
ub = tvb_get_guint8( tvb, offset );
|
|
|
|
proto_tree_add_text( field_tree, tvb, offset, 1,
|
|
|
|
"Max slot id: %u (0x%02x)",
|
|
|
|
ub, ub );
|
|
|
|
offset++;
|
|
|
|
length--;
|
|
|
|
|
|
|
|
if ( length > 0 ) {
|
|
|
|
/* second byte is "compress slot id" */
|
|
|
|
ub = tvb_get_guint8( tvb, offset );
|
|
|
|
proto_tree_add_text( field_tree, tvb, offset, 1,
|
|
|
|
"Compress slot id: %s (0x%02x)",
|
|
|
|
ub ? "yes" : "no", ub );
|
|
|
|
offset++;
|
|
|
|
length--;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case IPCP_COMPRESS_IPHC:
|
|
|
|
if ( length < 2 ) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
us = tvb_get_ntohs(tvb, offset);
|
|
|
|
proto_tree_add_text( field_tree, tvb, offset, 2,
|
|
|
|
"TCP space: %u (0x%04x)",
|
|
|
|
us, us );
|
|
|
|
offset += 2;
|
|
|
|
length -= 2;
|
|
|
|
|
|
|
|
|
|
|
|
if ( length < 2 ) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
us = tvb_get_ntohs(tvb, offset);
|
|
|
|
proto_tree_add_text( field_tree, tvb, offset, 2,
|
|
|
|
"Non-TCP space: %u (0x%04x)",
|
|
|
|
us, us );
|
|
|
|
offset += 2;
|
|
|
|
length -= 2;
|
|
|
|
|
|
|
|
|
|
|
|
if ( length < 2 ) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
us = tvb_get_ntohs(tvb, offset);
|
|
|
|
proto_tree_add_text( field_tree, tvb, offset, 2,
|
|
|
|
"Max period: %u (0x%04x) compressed packets",
|
|
|
|
us, us );
|
|
|
|
offset += 2;
|
|
|
|
length -= 2;
|
|
|
|
|
|
|
|
|
|
|
|
if ( length < 2 ) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
us = tvb_get_ntohs(tvb, offset);
|
|
|
|
proto_tree_add_text( field_tree, tvb, offset, 2,
|
|
|
|
"Max time: %u (0x%04x) seconds",
|
|
|
|
us, us );
|
|
|
|
offset += 2;
|
|
|
|
length -= 2;
|
|
|
|
|
|
|
|
|
|
|
|
if ( length < 2 ) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
us = tvb_get_ntohs(tvb, offset);
|
|
|
|
proto_tree_add_text( field_tree, tvb, offset, 2,
|
|
|
|
"Max header: %u (0x%04x) bytes",
|
|
|
|
us, us );
|
|
|
|
offset += 2;
|
|
|
|
length -= 2;
|
|
|
|
|
|
|
|
if ( length > 0 ) {
|
|
|
|
/* suboptions */
|
|
|
|
tf = proto_tree_add_text(field_tree, tvb, offset, length,
|
|
|
|
"Suboptions: (%u byte%s)",
|
|
|
|
length, plurality(length, "", "s"));
|
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
|
|
|
dissect_ip_tcp_options(tvb, offset, length,
|
|
|
|
ipcp_iphc_subopts, N_IPCP_IPHC_SUBOPTS, -1,
|
|
|
|
pinfo, field_tree);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (length > 0) {
|
|
|
|
proto_tree_add_text(field_tree, tvb, offset, length,
|
|
|
|
"Data (%d byte%s)", length,
|
|
|
|
plurality(length, "", "s"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void dissect_ipcp_iphc_disableprot_opt(const ip_tcp_opt *optp,
|
|
|
|
tvbuff_t *tvb,
|
|
|
|
int offset, guint length,
|
|
|
|
packet_info *pinfo _U_,
|
|
|
|
proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *tf;
|
|
|
|
proto_tree *field_tree;
|
|
|
|
guint8 param;
|
|
|
|
|
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length, "%s", optp->name);
|
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
|
|
|
|
|
|
|
param = tvb_get_guint8(tvb, offset + 2);
|
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 2, 1,
|
|
|
|
"Protocol: %s (0x%02x)",
|
|
|
|
val_to_str( param, ipcp_iphc_disable_proto_vals, "Unknown" ),
|
|
|
|
param );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-04-29 20:21:28 +00:00
|
|
|
static void dissect_osicp_align_npdu_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
|
|
|
proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *tf;
|
|
|
|
proto_tree *field_tree;
|
|
|
|
guint8 alignment;
|
|
|
|
|
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length, "%s", optp->name);
|
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
|
|
|
|
|
|
|
alignment = tvb_get_guint8(tvb, offset + 2);
|
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 2, 1,
|
|
|
|
"Alignment: %u", alignment);
|
|
|
|
}
|
|
|
|
|
2002-01-03 20:30:33 +00:00
|
|
|
static void dissect_pppmuxcp_def_pid_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
|
|
|
proto_tree *tree)
|
2002-08-28 21:04:11 +00:00
|
|
|
{
|
2002-01-03 20:30:33 +00:00
|
|
|
pppmux_def_prot_id = tvb_get_ntohs(tvb, offset + 2);
|
|
|
|
proto_tree_add_text(tree, tvb, offset + 2, length - 2, "%s: %s (0x%02x)",optp->name,
|
|
|
|
val_to_str(pppmux_def_prot_id, ppp_vals, "Unknown"), pppmux_def_prot_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-10-29 19:48:45 +00:00
|
|
|
static void
|
|
|
|
dissect_ccp_stac_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
2001-10-29 19:48:45 +00:00
|
|
|
proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *tf;
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree *field_tree;
|
2001-10-29 19:48:45 +00:00
|
|
|
guint8 check_mode;
|
|
|
|
|
|
|
|
if (length == 6) {
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset, length,
|
2002-04-01 00:51:43 +00:00
|
|
|
"%s (Ascend Proprietary version)", optp->name);
|
|
|
|
/* We don't know how to decode the following 4 octets, since
|
|
|
|
there's no public document that describe their usage. */
|
2001-10-29 19:48:45 +00:00
|
|
|
} else {
|
2002-04-01 00:51:43 +00:00
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length, "%s", optp->name);
|
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
|
|
|
|
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 2, 2,
|
|
|
|
"History Count: %u", tvb_get_ntohs(tvb, offset + 2));
|
|
|
|
check_mode = tvb_get_guint8(tvb, offset + 4);
|
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 4, 1,
|
2002-08-28 21:04:11 +00:00
|
|
|
"Check Mode: %s (0x%02X)",
|
2002-04-01 00:51:43 +00:00
|
|
|
val_to_str(check_mode, stac_checkmode_vals, "Unknown"),
|
2002-08-28 21:04:11 +00:00
|
|
|
check_mode);
|
2001-10-29 19:48:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_ccp_mppc_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
2001-10-29 19:48:45 +00:00
|
|
|
proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *tf;
|
|
|
|
proto_tree *flags_tree;
|
|
|
|
guint32 supported_bits;
|
|
|
|
|
|
|
|
supported_bits = tvb_get_ntohl(tvb, offset + 2);
|
2002-08-28 21:04:11 +00:00
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length,
|
2001-10-29 19:48:45 +00:00
|
|
|
"%s: Supported Bits: 0x%08X", optp->name, supported_bits);
|
2002-04-01 00:51:43 +00:00
|
|
|
flags_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
2001-10-29 19:48:45 +00:00
|
|
|
proto_tree_add_text(flags_tree, tvb, offset + 2, 4, "%s",
|
2002-08-28 21:04:11 +00:00
|
|
|
decode_boolean_bitfield(supported_bits, MPPC_SUPPORTED_BITS_C, 8*4,
|
2002-04-01 00:51:43 +00:00
|
|
|
"Desire to negotiate MPPC", "NO Desire to negotiate MPPC"));
|
2001-10-29 19:48:45 +00:00
|
|
|
proto_tree_add_text(flags_tree, tvb, offset + 2, 4, "%s",
|
2002-08-28 21:04:11 +00:00
|
|
|
decode_boolean_bitfield(supported_bits, MPPE_SUPPORTED_BITS_D, 8*4,
|
2001-10-29 19:48:45 +00:00
|
|
|
"Obsolete (should NOT be 1)", "Obsolete (should ALWAYS be 0)"));
|
|
|
|
proto_tree_add_text(flags_tree, tvb, offset + 2, 4, "%s",
|
2002-08-28 21:04:11 +00:00
|
|
|
decode_boolean_bitfield(supported_bits, MPPE_SUPPORTED_BITS_L, 8*4,
|
2001-10-29 19:48:45 +00:00
|
|
|
"40-bit encryption ON", "40-bit encryption OFF"));
|
|
|
|
proto_tree_add_text(flags_tree, tvb, offset + 2, 4, "%s",
|
2002-08-28 21:04:11 +00:00
|
|
|
decode_boolean_bitfield(supported_bits, MPPE_SUPPORTED_BITS_S, 8*4,
|
2001-10-30 10:16:51 +00:00
|
|
|
"128-bit encryption ON", "128-bit encryption OFF"));
|
2001-10-29 19:48:45 +00:00
|
|
|
proto_tree_add_text(flags_tree, tvb, offset + 2, 4, "%s",
|
2002-08-28 21:04:11 +00:00
|
|
|
decode_boolean_bitfield(supported_bits, MPPE_SUPPORTED_BITS_M, 8*4,
|
2001-10-30 10:16:51 +00:00
|
|
|
"56-bit encryption ON", "56-bit encryption OFF"));
|
2001-10-29 19:48:45 +00:00
|
|
|
proto_tree_add_text(flags_tree, tvb, offset + 2, 4, "%s",
|
2002-08-28 21:04:11 +00:00
|
|
|
decode_boolean_bitfield(supported_bits, MPPE_SUPPORTED_BITS_H, 8*4,
|
2001-10-29 19:48:45 +00:00
|
|
|
"Stateless mode ON", "Stateless mode OFF"));
|
|
|
|
}
|
|
|
|
|
2002-01-11 21:37:10 +00:00
|
|
|
static void
|
|
|
|
dissect_ccp_bsdcomp_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
2002-01-11 21:37:10 +00:00
|
|
|
proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *tf;
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree *field_tree;
|
2002-01-11 21:37:10 +00:00
|
|
|
|
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length, "%s", optp->name);
|
2002-04-01 00:51:43 +00:00
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
2002-01-11 21:37:10 +00:00
|
|
|
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 2, 1,
|
2002-01-11 21:37:10 +00:00
|
|
|
"Version: %u", tvb_get_guint8(tvb, offset + 2) >> 5);
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 2, 1,
|
2002-08-28 21:04:11 +00:00
|
|
|
"Dict: %u bits",
|
2002-01-11 21:37:10 +00:00
|
|
|
tvb_get_guint8(tvb, offset + 2) & 0x1f);
|
|
|
|
}
|
|
|
|
|
2001-10-29 19:48:45 +00:00
|
|
|
static void
|
|
|
|
dissect_ccp_lzsdcp_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
2001-10-29 19:48:45 +00:00
|
|
|
proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *tf;
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree *field_tree;
|
2001-10-29 19:48:45 +00:00
|
|
|
guint8 check_mode;
|
|
|
|
guint8 process_mode;
|
|
|
|
|
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length, "%s", optp->name);
|
2002-04-01 00:51:43 +00:00
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
2001-10-29 19:48:45 +00:00
|
|
|
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 2, 2,
|
2001-10-29 19:48:45 +00:00
|
|
|
"History Count: %u", tvb_get_ntohs(tvb, offset + 2));
|
|
|
|
check_mode = tvb_get_guint8(tvb, offset + 4);
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 4, 1,
|
2002-08-28 21:04:11 +00:00
|
|
|
"Check Mode: %s (0x%02X)",
|
2002-04-01 00:51:43 +00:00
|
|
|
val_to_str(check_mode, lzsdcp_checkmode_vals, "Unknown"),
|
2002-08-28 21:04:11 +00:00
|
|
|
check_mode);
|
2001-10-29 19:48:45 +00:00
|
|
|
process_mode = tvb_get_guint8(tvb, offset + 5);
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 5, 1,
|
2002-08-28 21:04:11 +00:00
|
|
|
"Process Mode: %s (0x%02X)",
|
2002-04-01 00:51:43 +00:00
|
|
|
val_to_str(process_mode, lzsdcp_processmode_vals, "Unkown"),
|
2002-08-28 21:04:11 +00:00
|
|
|
process_mode);
|
2001-10-29 19:48:45 +00:00
|
|
|
}
|
|
|
|
|
2002-01-11 21:37:10 +00:00
|
|
|
static void
|
|
|
|
dissect_ccp_mvrca_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
2002-01-11 21:37:10 +00:00
|
|
|
proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *tf;
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree *field_tree;
|
2002-01-11 21:37:10 +00:00
|
|
|
|
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length, "%s", optp->name);
|
2002-04-01 00:51:43 +00:00
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
2002-01-11 21:37:10 +00:00
|
|
|
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 2, 1,
|
2002-01-11 21:37:10 +00:00
|
|
|
"Features: %u", tvb_get_guint8(tvb, offset + 2) >> 5);
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 2, 1,
|
2002-08-28 21:04:11 +00:00
|
|
|
"Packet by Packet flag: %s",
|
2002-01-11 21:37:10 +00:00
|
|
|
tvb_get_guint8(tvb, offset + 2) & 0x20 ? "true" : "false");
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 2, 1,
|
2002-01-11 21:37:10 +00:00
|
|
|
"History: %u", tvb_get_guint8(tvb, offset + 2) & 0x20);
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 3, 1,
|
2002-01-11 21:37:10 +00:00
|
|
|
"Number of contexts: %u", tvb_get_guint8(tvb, offset + 3));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_ccp_deflate_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
2002-01-11 21:37:10 +00:00
|
|
|
proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *tf;
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree *field_tree;
|
2002-01-11 21:37:10 +00:00
|
|
|
guint8 method;
|
|
|
|
|
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length, "%s", optp->name);
|
2002-04-01 00:51:43 +00:00
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
2002-01-11 21:37:10 +00:00
|
|
|
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 2, 1,
|
2002-01-11 21:37:10 +00:00
|
|
|
"Window: %u", hi_nibble(tvb_get_guint8(tvb, offset + 2)));
|
|
|
|
method = lo_nibble(tvb_get_guint8(tvb, offset + 2));
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 2, 1,
|
2002-08-28 21:04:11 +00:00
|
|
|
"Method: %s (0x%02x)",
|
2002-01-11 21:37:10 +00:00
|
|
|
method == 0x08 ? "zlib compression" : "other", method);
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 3, 1,
|
2002-08-28 21:04:11 +00:00
|
|
|
"Sequence number check method: %u",
|
2002-01-11 21:37:10 +00:00
|
|
|
tvb_get_guint8(tvb, offset + 2) & 0x03);
|
|
|
|
}
|
|
|
|
|
2001-11-04 04:50:12 +00:00
|
|
|
static void
|
|
|
|
dissect_cbcp_no_callback_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
2001-11-04 04:50:12 +00:00
|
|
|
proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_tree_add_text(tree, tvb, offset, length, "%s", optp->name);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_cbcp_callback_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
2001-11-04 04:50:12 +00:00
|
|
|
proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *tf;
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree *field_tree;
|
2001-11-04 04:50:12 +00:00
|
|
|
proto_item *ta;
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree *addr_tree;
|
2001-11-04 04:50:12 +00:00
|
|
|
guint8 addr_type;
|
Add new routines:
tvb_get_string() - takes a tvbuff, an offset, and a length as
arguments, allocates a buffer big enough to hold a string with
the specified number of bytes plus an added null terminator
(i.e., length+1), copies the specified number of bytes from the
tvbuff, at the specified offset, to that buffer and puts in a
null terminator, and returns a pointer to that buffer (or throws
an exception before allocating the buffer if that many bytes
aren't available in the tvbuff);
tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to
a "gint" as arguments, gets the size of the null-terminated
string starting at the specified offset in the tvbuff (throwing
an exception if the null terminator isn't found), allocates a
buffer big enough to hold that string, copies the string to that
buffer, and returns a pointer to that buffer and stores the
length of the string (including the terminating null) in the
variable pointed to by the "gint" pointer.
Replace many pieces of code allocating a buffer and copying a string
with calls to "tvb_get_string()" (for one thing, "tvb_get_string()"
doesn't require you to remember that the argument to
"tvb_get_nstringz0()" is the size of the buffer into which you're
copying the string, which might be the length of the string to be copied
*plus 1*).
Don't use fixed-length buffers for null-terminated strings (even if the
code that generates those packets has a #define to limit the length of
the string). Use "tvb_get_stringz()", instead.
In some cases where a value is fetched but is only used to pass an
argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()"
instead.
svn path=/trunk/; revision=7859
2003-06-12 08:33:32 +00:00
|
|
|
guint addr_len;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-11-04 04:50:12 +00:00
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length, "%s", optp->name);
|
2002-04-01 00:51:43 +00:00
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
|
|
|
|
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 2, 1,
|
2001-11-04 04:50:12 +00:00
|
|
|
"Callback delay: %u", tvb_get_guint8(tvb, offset + 2));
|
|
|
|
offset += 3;
|
|
|
|
length -= 3;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-11-04 04:50:12 +00:00
|
|
|
while (length > 0) {
|
2002-08-28 21:04:11 +00:00
|
|
|
ta = proto_tree_add_text(field_tree, tvb, offset, length,
|
2002-04-01 00:51:43 +00:00
|
|
|
"Callback Address");
|
2002-08-28 21:04:11 +00:00
|
|
|
addr_type = tvb_get_guint8(tvb, offset);
|
2002-04-01 00:51:43 +00:00
|
|
|
addr_tree = proto_item_add_subtree(tf, ett_cbcp_callback_opt_addr);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_text(addr_tree, tvb, offset, 1,
|
|
|
|
"Address Type: %s (%u)",
|
2002-04-01 00:51:43 +00:00
|
|
|
((addr_type == 1) ? "PSTN/ISDN" : "Other"), addr_type);
|
|
|
|
offset++;
|
|
|
|
length--;
|
Add new routines:
tvb_get_string() - takes a tvbuff, an offset, and a length as
arguments, allocates a buffer big enough to hold a string with
the specified number of bytes plus an added null terminator
(i.e., length+1), copies the specified number of bytes from the
tvbuff, at the specified offset, to that buffer and puts in a
null terminator, and returns a pointer to that buffer (or throws
an exception before allocating the buffer if that many bytes
aren't available in the tvbuff);
tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to
a "gint" as arguments, gets the size of the null-terminated
string starting at the specified offset in the tvbuff (throwing
an exception if the null terminator isn't found), allocates a
buffer big enough to hold that string, copies the string to that
buffer, and returns a pointer to that buffer and stores the
length of the string (including the terminating null) in the
variable pointed to by the "gint" pointer.
Replace many pieces of code allocating a buffer and copying a string
with calls to "tvb_get_string()" (for one thing, "tvb_get_string()"
doesn't require you to remember that the argument to
"tvb_get_nstringz0()" is the size of the buffer into which you're
copying the string, which might be the length of the string to be copied
*plus 1*).
Don't use fixed-length buffers for null-terminated strings (even if the
code that generates those packets has a #define to limit the length of
the string). Use "tvb_get_stringz()", instead.
In some cases where a value is fetched but is only used to pass an
argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()"
instead.
svn path=/trunk/; revision=7859
2003-06-12 08:33:32 +00:00
|
|
|
addr_len = tvb_strsize(tvb, offset);
|
|
|
|
proto_tree_add_text(addr_tree, tvb, offset, addr_len,
|
|
|
|
"Address: %s",
|
2003-06-13 04:07:13 +00:00
|
|
|
tvb_format_text(tvb, offset, addr_len - 1));
|
2002-04-01 00:51:43 +00:00
|
|
|
offset += (addr_len + 1);
|
|
|
|
length -= (addr_len + 1);
|
2001-11-04 04:50:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-12-08 01:03:19 +00:00
|
|
|
static void
|
|
|
|
dissect_bacp_favored_peer_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
2001-12-08 01:03:19 +00:00
|
|
|
proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *tf;
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree *field_tree;
|
2001-12-08 01:03:19 +00:00
|
|
|
|
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length, "%s", optp->name);
|
2002-04-01 00:51:43 +00:00
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
2001-12-08 01:03:19 +00:00
|
|
|
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 2, 4,
|
2001-12-08 01:03:19 +00:00
|
|
|
"Magic number: 0x%08x", tvb_get_ntohl(tvb, offset + 2));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_bap_link_type_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
2001-12-08 01:03:19 +00:00
|
|
|
proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *tf;
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree *field_tree;
|
2001-12-08 01:03:19 +00:00
|
|
|
guint8 link_type;
|
|
|
|
|
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length, "%s", optp->name);
|
2002-04-01 00:51:43 +00:00
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
2001-12-08 01:03:19 +00:00
|
|
|
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 2, 2,
|
|
|
|
"Link Speed: %u kbps", tvb_get_ntohs(tvb, offset + 2));
|
2001-12-08 01:03:19 +00:00
|
|
|
link_type = tvb_get_guint8(tvb, offset + 4);
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 4, 1,
|
|
|
|
"Link Type: %s (%u)", val_to_str(link_type, bap_link_type_vals,
|
2001-12-08 01:03:19 +00:00
|
|
|
"Unknown"), link_type);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_bap_phone_delta_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
2001-12-08 01:03:19 +00:00
|
|
|
proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *tf;
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree *field_tree;
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *suboption_tree;
|
2001-12-08 01:03:19 +00:00
|
|
|
guint8 subopt_type;
|
|
|
|
guint8 subopt_len;
|
|
|
|
|
2002-04-01 00:51:43 +00:00
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length, "%s", optp->name);
|
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
2001-12-08 01:03:19 +00:00
|
|
|
|
|
|
|
offset += 2;
|
|
|
|
length -= 2;
|
|
|
|
|
|
|
|
while (length > 0) {
|
|
|
|
subopt_type = tvb_get_guint8(tvb, offset);
|
|
|
|
subopt_len = tvb_get_guint8(tvb, offset + 1);
|
2002-08-28 21:04:11 +00:00
|
|
|
ti = proto_tree_add_text(field_tree, tvb, offset, subopt_len,
|
2001-12-08 01:03:19 +00:00
|
|
|
"Sub-Option (%d byte%s)",
|
|
|
|
subopt_len, plurality(subopt_len, "", "s"));
|
2002-04-01 00:51:43 +00:00
|
|
|
suboption_tree = proto_item_add_subtree(ti, ett_bap_phone_delta_subopt);
|
2004-12-06 23:12:32 +00:00
|
|
|
if (subopt_len < 1) {
|
|
|
|
proto_tree_add_text(suboption_tree, tvb, offset + 1, 1,
|
|
|
|
"Invalid suboption length: %u", subopt_len);
|
|
|
|
return;
|
|
|
|
}
|
2001-12-08 01:03:19 +00:00
|
|
|
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree_add_text(suboption_tree, tvb, offset, 1,
|
2002-08-28 21:04:11 +00:00
|
|
|
"Sub-Option Type: %s (%u)",
|
2001-12-08 01:03:19 +00:00
|
|
|
val_to_str(subopt_type, bap_phone_delta_subopt_vals, "Unknown"),
|
|
|
|
subopt_type);
|
|
|
|
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree_add_text(suboption_tree, tvb, offset + 1, 1,
|
|
|
|
"Sub-Option Length: %u", subopt_len);
|
2001-12-08 01:03:19 +00:00
|
|
|
|
|
|
|
switch (subopt_type) {
|
|
|
|
case BAP_PHONE_DELTA_SUBOPT_UNIQ_DIGIT:
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_text(suboption_tree, tvb, offset + 2, 1, "Uniq Digit: %u",
|
2001-12-08 01:03:19 +00:00
|
|
|
tvb_get_guint8(tvb, offset + 2));
|
|
|
|
break;
|
|
|
|
case BAP_PHONE_DELTA_SUBOPT_SUBSC_NUM:
|
2003-05-19 03:23:12 +00:00
|
|
|
if (subopt_len > 2) {
|
2003-04-28 04:03:26 +00:00
|
|
|
proto_tree_add_text(suboption_tree, tvb, offset + 2, subopt_len - 2,
|
Add new routines:
tvb_get_string() - takes a tvbuff, an offset, and a length as
arguments, allocates a buffer big enough to hold a string with
the specified number of bytes plus an added null terminator
(i.e., length+1), copies the specified number of bytes from the
tvbuff, at the specified offset, to that buffer and puts in a
null terminator, and returns a pointer to that buffer (or throws
an exception before allocating the buffer if that many bytes
aren't available in the tvbuff);
tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to
a "gint" as arguments, gets the size of the null-terminated
string starting at the specified offset in the tvbuff (throwing
an exception if the null terminator isn't found), allocates a
buffer big enough to hold that string, copies the string to that
buffer, and returns a pointer to that buffer and stores the
length of the string (including the terminating null) in the
variable pointed to by the "gint" pointer.
Replace many pieces of code allocating a buffer and copying a string
with calls to "tvb_get_string()" (for one thing, "tvb_get_string()"
doesn't require you to remember that the argument to
"tvb_get_nstringz0()" is the size of the buffer into which you're
copying the string, which might be the length of the string to be copied
*plus 1*).
Don't use fixed-length buffers for null-terminated strings (even if the
code that generates those packets has a #define to limit the length of
the string). Use "tvb_get_stringz()", instead.
In some cases where a value is fetched but is only used to pass an
argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()"
instead.
svn path=/trunk/; revision=7859
2003-06-12 08:33:32 +00:00
|
|
|
"Subscriber Number: %s",
|
|
|
|
tvb_format_text(tvb, offset + 2, subopt_len - 2));
|
2003-04-28 04:03:26 +00:00
|
|
|
} else {
|
|
|
|
proto_tree_add_text(suboption_tree, tvb, offset + 1, 1,
|
|
|
|
"Invalid suboption length: %u", subopt_len);
|
|
|
|
}
|
2001-12-08 01:03:19 +00:00
|
|
|
break;
|
|
|
|
case BAP_PHONE_DELTA_SUBOPT_PHONENUM_SUBADDR:
|
2003-05-19 03:23:12 +00:00
|
|
|
if (subopt_len > 2) {
|
|
|
|
proto_tree_add_text(suboption_tree, tvb, offset + 2, subopt_len - 2,
|
Add new routines:
tvb_get_string() - takes a tvbuff, an offset, and a length as
arguments, allocates a buffer big enough to hold a string with
the specified number of bytes plus an added null terminator
(i.e., length+1), copies the specified number of bytes from the
tvbuff, at the specified offset, to that buffer and puts in a
null terminator, and returns a pointer to that buffer (or throws
an exception before allocating the buffer if that many bytes
aren't available in the tvbuff);
tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to
a "gint" as arguments, gets the size of the null-terminated
string starting at the specified offset in the tvbuff (throwing
an exception if the null terminator isn't found), allocates a
buffer big enough to hold that string, copies the string to that
buffer, and returns a pointer to that buffer and stores the
length of the string (including the terminating null) in the
variable pointed to by the "gint" pointer.
Replace many pieces of code allocating a buffer and copying a string
with calls to "tvb_get_string()" (for one thing, "tvb_get_string()"
doesn't require you to remember that the argument to
"tvb_get_nstringz0()" is the size of the buffer into which you're
copying the string, which might be the length of the string to be copied
*plus 1*).
Don't use fixed-length buffers for null-terminated strings (even if the
code that generates those packets has a #define to limit the length of
the string). Use "tvb_get_stringz()", instead.
In some cases where a value is fetched but is only used to pass an
argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()"
instead.
svn path=/trunk/; revision=7859
2003-06-12 08:33:32 +00:00
|
|
|
"Phone Number Sub Address: %s",
|
|
|
|
tvb_format_text(tvb, offset + 2, subopt_len - 2));
|
2004-12-06 23:12:32 +00:00
|
|
|
} else {
|
|
|
|
proto_tree_add_text(suboption_tree, tvb, offset + 1, 1,
|
|
|
|
"Invalid suboption length: %u", subopt_len);
|
2003-05-19 03:23:12 +00:00
|
|
|
}
|
2001-12-08 01:03:19 +00:00
|
|
|
break;
|
|
|
|
default:
|
2004-12-06 23:12:32 +00:00
|
|
|
if (subopt_len > 2) {
|
|
|
|
proto_tree_add_text(suboption_tree, tvb, offset + 2, subopt_len - 2,
|
2002-04-01 00:51:43 +00:00
|
|
|
"Unknown");
|
2004-12-06 23:12:32 +00:00
|
|
|
} else {
|
|
|
|
proto_tree_add_text(suboption_tree, tvb, offset + 1, 1,
|
|
|
|
"Invalid suboption length: %u", subopt_len);
|
|
|
|
}
|
2001-12-08 01:03:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
offset += subopt_len;
|
|
|
|
length -= subopt_len;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_bap_reason_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
2001-12-08 01:03:19 +00:00
|
|
|
proto_tree *tree)
|
|
|
|
{
|
2003-05-19 03:23:12 +00:00
|
|
|
if (length > 2) {
|
|
|
|
proto_tree_add_text(tree, tvb, offset, length, "%s: %s",
|
Add new routines:
tvb_get_string() - takes a tvbuff, an offset, and a length as
arguments, allocates a buffer big enough to hold a string with
the specified number of bytes plus an added null terminator
(i.e., length+1), copies the specified number of bytes from the
tvbuff, at the specified offset, to that buffer and puts in a
null terminator, and returns a pointer to that buffer (or throws
an exception before allocating the buffer if that many bytes
aren't available in the tvbuff);
tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to
a "gint" as arguments, gets the size of the null-terminated
string starting at the specified offset in the tvbuff (throwing
an exception if the null terminator isn't found), allocates a
buffer big enough to hold that string, copies the string to that
buffer, and returns a pointer to that buffer and stores the
length of the string (including the terminating null) in the
variable pointed to by the "gint" pointer.
Replace many pieces of code allocating a buffer and copying a string
with calls to "tvb_get_string()" (for one thing, "tvb_get_string()"
doesn't require you to remember that the argument to
"tvb_get_nstringz0()" is the size of the buffer into which you're
copying the string, which might be the length of the string to be copied
*plus 1*).
Don't use fixed-length buffers for null-terminated strings (even if the
code that generates those packets has a #define to limit the length of
the string). Use "tvb_get_stringz()", instead.
In some cases where a value is fetched but is only used to pass an
argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()"
instead.
svn path=/trunk/; revision=7859
2003-06-12 08:33:32 +00:00
|
|
|
optp->name,
|
|
|
|
tvb_format_text(tvb, offset + 2, length - 2));
|
2003-05-19 03:23:12 +00:00
|
|
|
}
|
2001-12-08 01:03:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_bap_link_disc_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
2001-12-08 01:03:19 +00:00
|
|
|
proto_tree *tree)
|
|
|
|
{
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset, length, "%s: 0x%04x",
|
2001-12-08 01:03:19 +00:00
|
|
|
optp->name, tvb_get_ntohs(tvb, offset + 2));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_bap_call_status_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-03-31 22:37:09 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
2001-12-08 01:03:19 +00:00
|
|
|
proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *tf;
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree *field_tree;
|
2001-12-08 01:03:19 +00:00
|
|
|
guint8 status, action;
|
|
|
|
|
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, length, "%s", optp->name);
|
2002-04-01 00:51:43 +00:00
|
|
|
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
|
2001-12-08 01:03:19 +00:00
|
|
|
|
|
|
|
status = tvb_get_guint8(tvb, offset + 2);
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 2, 1,
|
2002-08-28 21:04:11 +00:00
|
|
|
"Status: %s (0x%02x)",
|
2001-12-08 01:03:19 +00:00
|
|
|
val_to_str(status, q931_cause_code_vals, "Unknown"), status);
|
|
|
|
|
|
|
|
action = tvb_get_guint8(tvb, offset + 3);
|
2002-04-01 00:51:43 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset + 3, 1,
|
2002-08-28 21:04:11 +00:00
|
|
|
"Action: %s (0x%02x)",
|
2001-12-08 01:03:19 +00:00
|
|
|
val_to_str(action, bap_call_status_opt_action_vals, "Unknown"), action);
|
|
|
|
}
|
|
|
|
|
1999-08-25 06:52:04 +00:00
|
|
|
static void
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
dissect_cp( tvbuff_t *tvb, int proto_id, int proto_subtree_index,
|
1999-08-25 06:52:04 +00:00
|
|
|
const value_string *proto_vals, int options_subtree_index,
|
2002-05-20 00:56:30 +00:00
|
|
|
const ip_tcp_opt *opts, int nopts, packet_info *pinfo,
|
|
|
|
proto_tree *tree )
|
|
|
|
{
|
1999-06-11 15:30:55 +00:00
|
|
|
proto_item *ti;
|
2003-01-20 05:42:37 +00:00
|
|
|
proto_tree *fh_tree = NULL;
|
1999-08-25 06:52:04 +00:00
|
|
|
proto_item *tf;
|
|
|
|
proto_tree *field_tree;
|
1999-06-11 15:30:55 +00:00
|
|
|
|
1999-08-25 06:52:04 +00:00
|
|
|
guint8 code;
|
|
|
|
guint8 id;
|
2000-05-25 07:42:26 +00:00
|
|
|
int length, offset;
|
1999-08-25 06:52:04 +00:00
|
|
|
guint16 protocol;
|
1999-06-11 15:30:55 +00:00
|
|
|
|
2000-05-25 07:42:26 +00:00
|
|
|
code = tvb_get_guint8(tvb, 0);
|
|
|
|
id = tvb_get_guint8(tvb, 1);
|
|
|
|
length = tvb_get_ntohs(tvb, 2);
|
1999-08-25 06:52:04 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL,
|
2003-11-16 23:17:27 +00:00
|
|
|
proto_get_protocol_short_name(find_protocol_by_id(proto_id)));
|
2001-06-16 00:51:45 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO))
|
2003-11-16 23:17:27 +00:00
|
|
|
col_add_str(pinfo->cinfo, COL_INFO,
|
1999-08-25 06:52:04 +00:00
|
|
|
val_to_str(code, proto_vals, "Unknown"));
|
1999-06-11 15:30:55 +00:00
|
|
|
|
|
|
|
if(tree) {
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_id, tvb, 0, length, FALSE);
|
1999-08-25 06:52:04 +00:00
|
|
|
fh_tree = proto_item_add_subtree(ti, proto_subtree_index);
|
2000-05-25 07:42:26 +00:00
|
|
|
proto_tree_add_text(fh_tree, tvb, 0, 1, "Code: %s (0x%02x)",
|
1999-08-25 06:52:04 +00:00
|
|
|
val_to_str(code, proto_vals, "Unknown"), code);
|
2000-05-25 07:42:26 +00:00
|
|
|
proto_tree_add_text(fh_tree, tvb, 1, 1, "Identifier: 0x%02x",
|
1999-08-25 06:52:04 +00:00
|
|
|
id);
|
2000-05-25 07:42:26 +00:00
|
|
|
proto_tree_add_text(fh_tree, tvb, 2, 2, "Length: %u",
|
1999-08-25 06:52:04 +00:00
|
|
|
length);
|
1999-06-11 15:30:55 +00:00
|
|
|
}
|
2000-05-25 07:42:26 +00:00
|
|
|
offset = 4;
|
1999-08-25 07:32:46 +00:00
|
|
|
length -= 4;
|
1999-08-25 06:52:04 +00:00
|
|
|
|
|
|
|
switch (code) {
|
|
|
|
case CONFREQ:
|
|
|
|
case CONFACK:
|
|
|
|
case CONFNAK:
|
|
|
|
case CONFREJ:
|
|
|
|
if(tree) {
|
1999-08-25 07:32:46 +00:00
|
|
|
if (length > 0) {
|
2000-05-25 07:42:26 +00:00
|
|
|
tf = proto_tree_add_text(fh_tree, tvb, offset, length,
|
1999-08-25 07:32:46 +00:00
|
|
|
"Options: (%d byte%s)", length, plurality(length, "", "s"));
|
1999-08-25 06:52:04 +00:00
|
|
|
field_tree = proto_item_add_subtree(tf, options_subtree_index);
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
dissect_ip_tcp_options(tvb, offset, length, opts, nopts, -1,
|
2001-12-10 00:26:21 +00:00
|
|
|
pinfo, field_tree);
|
1999-08-25 06:52:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
1999-06-11 15:30:55 +00:00
|
|
|
|
1999-08-25 06:52:04 +00:00
|
|
|
case ECHOREQ:
|
|
|
|
case ECHOREP:
|
|
|
|
case DISCREQ:
|
1999-08-25 07:32:46 +00:00
|
|
|
case IDENT:
|
1999-08-25 06:52:04 +00:00
|
|
|
if(tree) {
|
2000-05-25 07:42:26 +00:00
|
|
|
proto_tree_add_text(fh_tree, tvb, offset, 4, "Magic number: 0x%08x",
|
|
|
|
tvb_get_ntohl(tvb, offset));
|
1999-08-25 06:52:04 +00:00
|
|
|
offset += 4;
|
1999-08-25 07:32:46 +00:00
|
|
|
length -= 4;
|
|
|
|
if (length > 0)
|
2000-05-25 07:42:26 +00:00
|
|
|
proto_tree_add_text(fh_tree, tvb, offset, length, "Message (%d byte%s)",
|
1999-08-25 07:32:46 +00:00
|
|
|
length, plurality(length, "", "s"));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TIMEREMAIN:
|
|
|
|
if(tree) {
|
2000-05-25 07:42:26 +00:00
|
|
|
proto_tree_add_text(fh_tree, tvb, offset, 4, "Magic number: 0x%08x",
|
|
|
|
tvb_get_ntohl(tvb, offset));
|
1999-08-25 07:32:46 +00:00
|
|
|
offset += 4;
|
|
|
|
length -= 4;
|
2000-05-25 07:42:26 +00:00
|
|
|
proto_tree_add_text(fh_tree, tvb, offset, 4, "Seconds remaining: %u",
|
|
|
|
tvb_get_ntohl(tvb, offset));
|
1999-08-25 07:32:46 +00:00
|
|
|
offset += 4;
|
|
|
|
length -= 4;
|
|
|
|
if (length > 0)
|
2000-05-25 07:42:26 +00:00
|
|
|
proto_tree_add_text(fh_tree, tvb, offset, length, "Message (%d byte%s)",
|
1999-08-25 07:32:46 +00:00
|
|
|
length, plurality(length, "", "s"));
|
1999-08-25 06:52:04 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PROTREJ:
|
|
|
|
if(tree) {
|
2002-11-28 22:18:53 +00:00
|
|
|
gboolean save_in_error_pkt;
|
2002-11-28 20:48:14 +00:00
|
|
|
tvbuff_t *next_tvb;
|
|
|
|
|
|
|
|
protocol = tvb_get_ntohs(tvb, offset);
|
|
|
|
proto_tree_add_text(fh_tree, tvb, offset, 2,
|
|
|
|
"Rejected protocol: %s (0x%04x)",
|
|
|
|
val_to_str(protocol, ppp_vals, "Unknown"),
|
|
|
|
protocol);
|
1999-08-25 06:52:04 +00:00
|
|
|
offset += 2;
|
1999-08-25 07:32:46 +00:00
|
|
|
length -= 2;
|
2002-11-28 20:48:14 +00:00
|
|
|
if (length > 0) {
|
|
|
|
proto_tree_add_text(fh_tree, tvb, offset, length,
|
|
|
|
"Rejected packet (%d byte%s)",
|
|
|
|
length, plurality(length, "", "s"));
|
|
|
|
|
2002-11-28 22:18:53 +00:00
|
|
|
/* Save the current value of the "we're inside an error packet"
|
|
|
|
flag, and set that flag; subdissectors may treat packets
|
|
|
|
that are the payload of error packets differently from
|
|
|
|
"real" packets. */
|
|
|
|
save_in_error_pkt = pinfo->in_error_pkt;
|
|
|
|
pinfo->in_error_pkt = TRUE;
|
|
|
|
|
2003-01-20 05:42:37 +00:00
|
|
|
/* Decode the rejected packet. */
|
2002-11-28 20:48:14 +00:00
|
|
|
next_tvb = tvb_new_subset(tvb, offset, length, length);
|
2003-01-20 05:42:37 +00:00
|
|
|
if (!dissector_try_port(ppp_subdissector_table, protocol,
|
|
|
|
next_tvb, pinfo, fh_tree)) {
|
|
|
|
call_dissector(data_handle, next_tvb, pinfo, fh_tree);
|
2002-11-28 20:48:14 +00:00
|
|
|
}
|
|
|
|
|
2002-11-28 22:18:53 +00:00
|
|
|
/* Restore the "we're inside an error packet" flag. */
|
|
|
|
pinfo->in_error_pkt = save_in_error_pkt;
|
2002-11-28 20:48:14 +00:00
|
|
|
}
|
1999-08-25 06:52:04 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CODEREJ:
|
|
|
|
/* decode the rejected LCP packet here. */
|
1999-08-25 07:32:46 +00:00
|
|
|
if (length > 0)
|
2000-05-25 07:42:26 +00:00
|
|
|
proto_tree_add_text(fh_tree, tvb, offset, length, "Rejected packet (%d byte%s)",
|
1999-08-25 07:32:46 +00:00
|
|
|
length, plurality(length, "", "s"));
|
|
|
|
break;
|
1999-08-25 06:52:04 +00:00
|
|
|
|
|
|
|
case TERMREQ:
|
|
|
|
case TERMACK:
|
1999-08-25 07:32:46 +00:00
|
|
|
if (length > 0)
|
2000-05-25 07:42:26 +00:00
|
|
|
proto_tree_add_text(fh_tree, tvb, offset, length, "Data (%d byte%s)",
|
1999-08-25 07:32:46 +00:00
|
|
|
length, plurality(length, "", "s"));
|
|
|
|
break;
|
|
|
|
|
1999-06-11 15:30:55 +00:00
|
|
|
default:
|
1999-08-25 07:32:46 +00:00
|
|
|
if (length > 0)
|
2000-05-25 07:42:26 +00:00
|
|
|
proto_tree_add_text(fh_tree, tvb, offset, length, "Stuff (%d byte%s)",
|
1999-08-25 07:32:46 +00:00
|
|
|
length, plurality(length, "", "s"));
|
1999-06-11 15:30:55 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-09-11 04:19:26 +00:00
|
|
|
/* Protocol field compression */
|
|
|
|
#define PFC_BIT 0x01
|
|
|
|
|
2001-03-29 09:18:34 +00:00
|
|
|
static void
|
2002-05-20 00:56:30 +00:00
|
|
|
dissect_ppp_common( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
2004-10-30 08:45:10 +00:00
|
|
|
proto_tree *fh_tree, proto_item *ti, int proto_offset )
|
2002-05-20 00:56:30 +00:00
|
|
|
{
|
1999-08-25 03:56:07 +00:00
|
|
|
guint16 ppp_prot;
|
1999-09-11 04:19:26 +00:00
|
|
|
int proto_len;
|
2000-05-25 07:42:26 +00:00
|
|
|
tvbuff_t *next_tvb;
|
1999-09-11 04:19:26 +00:00
|
|
|
|
2002-05-20 00:56:30 +00:00
|
|
|
ppp_prot = tvb_get_guint8(tvb, 0);
|
2001-03-29 09:18:34 +00:00
|
|
|
if (ppp_prot & PFC_BIT) {
|
|
|
|
/* Compressed protocol field - just the byte we fetched. */
|
1999-09-11 04:19:26 +00:00
|
|
|
proto_len = 1;
|
|
|
|
} else {
|
2001-03-29 09:18:34 +00:00
|
|
|
/* Uncompressed protocol field - fetch all of it. */
|
2002-05-20 00:56:30 +00:00
|
|
|
ppp_prot = tvb_get_ntohs(tvb, 0);
|
1999-09-11 04:19:26 +00:00
|
|
|
proto_len = 2;
|
|
|
|
}
|
1999-08-25 03:56:07 +00:00
|
|
|
|
2001-03-29 09:18:34 +00:00
|
|
|
/* If "ti" is not null, it refers to the top-level "proto_ppp" item
|
2004-10-30 08:45:10 +00:00
|
|
|
for PPP, and proto_offset is the length of any stuff in the header
|
|
|
|
preceding the protocol type, e.g. an HDLC header; add the length
|
|
|
|
of the protocol type field to it, and set the length of that item
|
|
|
|
to the result. */
|
2001-03-29 09:18:34 +00:00
|
|
|
if (ti != NULL)
|
2004-10-30 08:45:10 +00:00
|
|
|
proto_item_set_len(ti, proto_offset + proto_len);
|
2001-03-29 09:18:34 +00:00
|
|
|
|
2002-05-20 00:56:30 +00:00
|
|
|
if (tree)
|
|
|
|
proto_tree_add_uint(fh_tree, hf_ppp_protocol, tvb, 0, proto_len, ppp_prot);
|
2000-05-25 07:42:26 +00:00
|
|
|
|
2002-05-20 00:56:30 +00:00
|
|
|
next_tvb = tvb_new_subset(tvb, proto_len, -1, -1);
|
1999-06-11 15:30:55 +00:00
|
|
|
|
2000-04-16 21:37:07 +00:00
|
|
|
/* do lookup with the subdissector table */
|
Instead of tweaking a "Protocol configuration options" extension header
item to look more-or-less like a PPP packet, just dissect it in place
and hand off to the appropriate subdissector using the PPP dissector's
handoff table (which we export, along with its value_string table for
protocol IDs, which we use to report the protocol ID symbolically).
This means there's no point in having a configurable option to control
whether to do that tweaking; make it an obsolete option.
Bring "col_get_writable()" back from the dead, and have the GTP
dissector save the current "writable" flag for columns, mark the columns
non-writable before calling the subdissector for the PPP configuration
protocol, and restore the state of the writable flag, rather than
putting the columns back after the PPP configuration protocol's
dissector is done.
Fix some more typos in comments.
Don't register the IP dissector in the "ppp.protocol" table in the GTP
dissector's handoff registration routine - it's already being done in
the IP dissector's handoff routine.
Fix the name for CHAP to match what RFC 1994 calls it (if the name
changed, it should be changed in all places, but, at least according to
this message, a while ago, from Bob Sutterfield, "since the RFC defines
the protocol, the RFC defines the name":
http://mail-index.netbsd.org/netbsd-help/1996/05/16/0011.html
and the RFC defines the name as "PPP Challenge Handshake Authentication
Protocol (CHAP)").
svn path=/trunk/; revision=6617
2002-11-11 19:23:14 +00:00
|
|
|
if (!dissector_try_port(ppp_subdissector_table, ppp_prot, next_tvb, pinfo, tree)) {
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "0x%04x", ppp_prot);
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "PPP %s (0x%04x)",
|
2001-03-29 09:18:34 +00:00
|
|
|
val_to_str(ppp_prot, ppp_vals, "Unknown"), ppp_prot);
|
2001-11-25 22:51:14 +00:00
|
|
|
call_dissector(data_handle,next_tvb, pinfo, tree);
|
2001-03-29 09:18:34 +00:00
|
|
|
}
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
}
|
|
|
|
|
2002-12-11 19:59:08 +00:00
|
|
|
static void
|
|
|
|
dissect_lcp_options(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
dissect_ip_tcp_options(tvb, 0, tvb_reported_length(tvb), lcp_opts, N_LCP_OPTS,
|
|
|
|
-1, pinfo, tree);
|
|
|
|
}
|
|
|
|
|
Add new routines:
tvb_get_string() - takes a tvbuff, an offset, and a length as
arguments, allocates a buffer big enough to hold a string with
the specified number of bytes plus an added null terminator
(i.e., length+1), copies the specified number of bytes from the
tvbuff, at the specified offset, to that buffer and puts in a
null terminator, and returns a pointer to that buffer (or throws
an exception before allocating the buffer if that many bytes
aren't available in the tvbuff);
tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to
a "gint" as arguments, gets the size of the null-terminated
string starting at the specified offset in the tvbuff (throwing
an exception if the null terminator isn't found), allocates a
buffer big enough to hold that string, copies the string to that
buffer, and returns a pointer to that buffer and stores the
length of the string (including the terminating null) in the
variable pointed to by the "gint" pointer.
Replace many pieces of code allocating a buffer and copying a string
with calls to "tvb_get_string()" (for one thing, "tvb_get_string()"
doesn't require you to remember that the argument to
"tvb_get_nstringz0()" is the size of the buffer into which you're
copying the string, which might be the length of the string to be copied
*plus 1*).
Don't use fixed-length buffers for null-terminated strings (even if the
code that generates those packets has a #define to limit the length of
the string). Use "tvb_get_stringz()", instead.
In some cases where a value is fetched but is only used to pass an
argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()"
instead.
svn path=/trunk/; revision=7859
2003-06-12 08:33:32 +00:00
|
|
|
/*
|
|
|
|
* RFC 1661.
|
|
|
|
*/
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
static void
|
|
|
|
dissect_lcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
dissect_cp(tvb, proto_lcp, ett_lcp, lcp_vals, ett_lcp_options,
|
|
|
|
lcp_opts, N_LCP_OPTS, pinfo, tree);
|
|
|
|
}
|
|
|
|
|
Add new routines:
tvb_get_string() - takes a tvbuff, an offset, and a length as
arguments, allocates a buffer big enough to hold a string with
the specified number of bytes plus an added null terminator
(i.e., length+1), copies the specified number of bytes from the
tvbuff, at the specified offset, to that buffer and puts in a
null terminator, and returns a pointer to that buffer (or throws
an exception before allocating the buffer if that many bytes
aren't available in the tvbuff);
tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to
a "gint" as arguments, gets the size of the null-terminated
string starting at the specified offset in the tvbuff (throwing
an exception if the null terminator isn't found), allocates a
buffer big enough to hold that string, copies the string to that
buffer, and returns a pointer to that buffer and stores the
length of the string (including the terminating null) in the
variable pointed to by the "gint" pointer.
Replace many pieces of code allocating a buffer and copying a string
with calls to "tvb_get_string()" (for one thing, "tvb_get_string()"
doesn't require you to remember that the argument to
"tvb_get_nstringz0()" is the size of the buffer into which you're
copying the string, which might be the length of the string to be copied
*plus 1*).
Don't use fixed-length buffers for null-terminated strings (even if the
code that generates those packets has a #define to limit the length of
the string). Use "tvb_get_stringz()", instead.
In some cases where a value is fetched but is only used to pass an
argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()"
instead.
svn path=/trunk/; revision=7859
2003-06-12 08:33:32 +00:00
|
|
|
/*
|
|
|
|
* RFC 1332.
|
|
|
|
*/
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
static void
|
|
|
|
dissect_ipcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
dissect_cp(tvb, proto_ipcp, ett_ipcp, cp_vals, ett_ipcp_options,
|
|
|
|
ipcp_opts, N_IPCP_OPTS, pinfo, tree);
|
1999-08-25 03:56:07 +00:00
|
|
|
}
|
|
|
|
|
2004-04-29 20:21:28 +00:00
|
|
|
/*
|
|
|
|
* RFC 1377.
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
dissect_osicp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
dissect_cp(tvb, proto_osicp, ett_osicp, cp_vals, ett_osicp_options,
|
|
|
|
osicp_opts, N_OSICP_OPTS, pinfo, tree);
|
|
|
|
}
|
|
|
|
|
Add new routines:
tvb_get_string() - takes a tvbuff, an offset, and a length as
arguments, allocates a buffer big enough to hold a string with
the specified number of bytes plus an added null terminator
(i.e., length+1), copies the specified number of bytes from the
tvbuff, at the specified offset, to that buffer and puts in a
null terminator, and returns a pointer to that buffer (or throws
an exception before allocating the buffer if that many bytes
aren't available in the tvbuff);
tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to
a "gint" as arguments, gets the size of the null-terminated
string starting at the specified offset in the tvbuff (throwing
an exception if the null terminator isn't found), allocates a
buffer big enough to hold that string, copies the string to that
buffer, and returns a pointer to that buffer and stores the
length of the string (including the terminating null) in the
variable pointed to by the "gint" pointer.
Replace many pieces of code allocating a buffer and copying a string
with calls to "tvb_get_string()" (for one thing, "tvb_get_string()"
doesn't require you to remember that the argument to
"tvb_get_nstringz0()" is the size of the buffer into which you're
copying the string, which might be the length of the string to be copied
*plus 1*).
Don't use fixed-length buffers for null-terminated strings (even if the
code that generates those packets has a #define to limit the length of
the string). Use "tvb_get_stringz()", instead.
In some cases where a value is fetched but is only used to pass an
argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()"
instead.
svn path=/trunk/; revision=7859
2003-06-12 08:33:32 +00:00
|
|
|
/*
|
|
|
|
* RFC 1962.
|
|
|
|
*/
|
2001-10-29 19:48:45 +00:00
|
|
|
static void
|
|
|
|
dissect_ccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
dissect_cp(tvb, proto_ccp, ett_ccp, ccp_vals, ett_ccp_options,
|
|
|
|
ccp_opts, N_CCP_OPTS, pinfo, tree);
|
|
|
|
}
|
|
|
|
|
Add new routines:
tvb_get_string() - takes a tvbuff, an offset, and a length as
arguments, allocates a buffer big enough to hold a string with
the specified number of bytes plus an added null terminator
(i.e., length+1), copies the specified number of bytes from the
tvbuff, at the specified offset, to that buffer and puts in a
null terminator, and returns a pointer to that buffer (or throws
an exception before allocating the buffer if that many bytes
aren't available in the tvbuff);
tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to
a "gint" as arguments, gets the size of the null-terminated
string starting at the specified offset in the tvbuff (throwing
an exception if the null terminator isn't found), allocates a
buffer big enough to hold that string, copies the string to that
buffer, and returns a pointer to that buffer and stores the
length of the string (including the terminating null) in the
variable pointed to by the "gint" pointer.
Replace many pieces of code allocating a buffer and copying a string
with calls to "tvb_get_string()" (for one thing, "tvb_get_string()"
doesn't require you to remember that the argument to
"tvb_get_nstringz0()" is the size of the buffer into which you're
copying the string, which might be the length of the string to be copied
*plus 1*).
Don't use fixed-length buffers for null-terminated strings (even if the
code that generates those packets has a #define to limit the length of
the string). Use "tvb_get_stringz()", instead.
In some cases where a value is fetched but is only used to pass an
argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()"
instead.
svn path=/trunk/; revision=7859
2003-06-12 08:33:32 +00:00
|
|
|
/*
|
|
|
|
* Callback Control Protocol - see
|
|
|
|
*
|
|
|
|
* http://www.linet.gr.jp/~manabe/PPxP/doc/Standards/draft-gidwani-ppp-callback-cp-00.txt
|
|
|
|
*/
|
2001-11-04 04:50:12 +00:00
|
|
|
static void
|
|
|
|
dissect_cbcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
dissect_cp(tvb, proto_cbcp, ett_cbcp, cbcp_vals, ett_cbcp_options,
|
|
|
|
cbcp_opts, N_CBCP_OPTS, pinfo, tree);
|
|
|
|
}
|
|
|
|
|
Add new routines:
tvb_get_string() - takes a tvbuff, an offset, and a length as
arguments, allocates a buffer big enough to hold a string with
the specified number of bytes plus an added null terminator
(i.e., length+1), copies the specified number of bytes from the
tvbuff, at the specified offset, to that buffer and puts in a
null terminator, and returns a pointer to that buffer (or throws
an exception before allocating the buffer if that many bytes
aren't available in the tvbuff);
tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to
a "gint" as arguments, gets the size of the null-terminated
string starting at the specified offset in the tvbuff (throwing
an exception if the null terminator isn't found), allocates a
buffer big enough to hold that string, copies the string to that
buffer, and returns a pointer to that buffer and stores the
length of the string (including the terminating null) in the
variable pointed to by the "gint" pointer.
Replace many pieces of code allocating a buffer and copying a string
with calls to "tvb_get_string()" (for one thing, "tvb_get_string()"
doesn't require you to remember that the argument to
"tvb_get_nstringz0()" is the size of the buffer into which you're
copying the string, which might be the length of the string to be copied
*plus 1*).
Don't use fixed-length buffers for null-terminated strings (even if the
code that generates those packets has a #define to limit the length of
the string). Use "tvb_get_stringz()", instead.
In some cases where a value is fetched but is only used to pass an
argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()"
instead.
svn path=/trunk/; revision=7859
2003-06-12 08:33:32 +00:00
|
|
|
/*
|
|
|
|
* RFC 2125 (BACP and BAP).
|
|
|
|
*/
|
2001-12-08 01:03:19 +00:00
|
|
|
static void
|
|
|
|
dissect_bacp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
dissect_cp(tvb, proto_bacp, ett_bacp, cp_vals, ett_bacp_options,
|
|
|
|
bacp_opts, N_BACP_OPTS, pinfo, tree);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_bap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *fh_tree = NULL;
|
|
|
|
proto_item *tf;
|
|
|
|
proto_tree *field_tree;
|
|
|
|
|
|
|
|
guint8 type;
|
|
|
|
guint8 id;
|
|
|
|
int length, offset;
|
|
|
|
guint8 resp_code;
|
|
|
|
|
|
|
|
type = tvb_get_guint8(tvb, 0);
|
|
|
|
id = tvb_get_guint8(tvb, 1);
|
|
|
|
length = tvb_get_ntohs(tvb, 2);
|
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_PROTOCOL))
|
2003-11-16 23:17:27 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PPP BAP");
|
2001-12-08 01:03:19 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO))
|
2003-11-16 23:17:27 +00:00
|
|
|
col_add_str(pinfo->cinfo, COL_INFO,
|
2001-12-08 01:03:19 +00:00
|
|
|
val_to_str(type, bap_vals, "Unknown"));
|
|
|
|
|
|
|
|
if(tree) {
|
|
|
|
ti = proto_tree_add_item(tree, proto_bap, tvb, 0, length, FALSE);
|
|
|
|
fh_tree = proto_item_add_subtree(ti, ett_bap_options);
|
|
|
|
proto_tree_add_text(fh_tree, tvb, 0, 1, "Type: %s (0x%02x)",
|
|
|
|
val_to_str(type, bap_vals, "Unknown"), type);
|
|
|
|
proto_tree_add_text(fh_tree, tvb, 1, 1, "Identifier: 0x%02x",
|
|
|
|
id);
|
|
|
|
proto_tree_add_text(fh_tree, tvb, 2, 2, "Length: %u",
|
|
|
|
length);
|
|
|
|
}
|
|
|
|
offset = 4;
|
|
|
|
length -= 4;
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
if (type == BAP_CRES || type == BAP_CBRES ||
|
2001-12-08 01:03:19 +00:00
|
|
|
type == BAP_LDQRES || type == BAP_CSRES) {
|
|
|
|
resp_code = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_text(fh_tree, tvb, offset, 1, "Response Code: %s (0x%02x)",
|
|
|
|
val_to_str(resp_code, bap_resp_code_vals, "Unknown"), resp_code);
|
|
|
|
offset++;
|
|
|
|
length--;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(tree) {
|
|
|
|
if (length > 0) {
|
|
|
|
tf = proto_tree_add_text(fh_tree, tvb, offset, length,
|
|
|
|
"Data (%d byte%s)", length, plurality(length, "", "s"));
|
|
|
|
field_tree = proto_item_add_subtree(tf, ett_bap_options);
|
|
|
|
dissect_ip_tcp_options(tvb, offset, length, bap_opts, N_BAP_OPTS, -1,
|
2001-12-10 00:26:21 +00:00
|
|
|
pinfo, field_tree);
|
2001-12-08 01:03:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-10-29 19:48:45 +00:00
|
|
|
static void
|
|
|
|
dissect_comp_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *comp_data_tree;
|
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
2003-11-16 23:17:27 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PPP Comp");
|
2001-10-29 19:48:45 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO))
|
2003-11-16 23:17:27 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "Compressed data");
|
2001-10-29 19:48:45 +00:00
|
|
|
|
|
|
|
if (tree) {
|
Allow a length of -1 to be specified when adding FT_NONE and FT_PROTOCOL
items to the protocol tree; it's interpreted as "the rest of the data in
the tvbuff". This can be used if
1) the item covers the entire packet or the remaining payload in
the packet
or
2) the item's length won't be known until it's dissected, and
will be then set with "proto_item_set_len()" - if an
exception is thrown in the dissection, it means the item ran
*past* the end of the tvbuff, so saying it runs to the end of
the tvbuff is reasonable.
Convert a number of "proto_tree_add_XXX()" calls using
"tvb_length_remaining()", values derived from the result of
"tvb_length()", or 0 (in the case of items whose length is unknown) to
use -1 instead (using 0 means that if an exception is thrown, selecting
the item highlights nothing; using -1 means it highlights all the data
for that item that's available).
In some places where "tvb_length()" or "tvb_length_remaining()" was used
to determine how large a packet is, use "tvb_reported_length()" or
"tvb_reported_length_remaining()", instead - the first two calls
indicate how much captured data was in the packet, the latter two calls
indicate how large the packet actually was (and the fact that using the
latter could cause BoundsError exceptions to be thrown is a feature - if
such an exception is thrown, the frame really *was* short, and it should
be tagged as such).
Replace some "proto_tree_add_XXX()" calls with equivalent
"proto_tree_add_item()" calls.
Fix some indentation.
svn path=/trunk/; revision=4578
2002-01-20 22:12:39 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_comp_data, tvb, 0, -1, FALSE);
|
2001-10-29 19:48:45 +00:00
|
|
|
comp_data_tree = proto_item_add_subtree(ti, ett_comp_data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Add new routines:
tvb_get_string() - takes a tvbuff, an offset, and a length as
arguments, allocates a buffer big enough to hold a string with
the specified number of bytes plus an added null terminator
(i.e., length+1), copies the specified number of bytes from the
tvbuff, at the specified offset, to that buffer and puts in a
null terminator, and returns a pointer to that buffer (or throws
an exception before allocating the buffer if that many bytes
aren't available in the tvbuff);
tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to
a "gint" as arguments, gets the size of the null-terminated
string starting at the specified offset in the tvbuff (throwing
an exception if the null terminator isn't found), allocates a
buffer big enough to hold that string, copies the string to that
buffer, and returns a pointer to that buffer and stores the
length of the string (including the terminating null) in the
variable pointed to by the "gint" pointer.
Replace many pieces of code allocating a buffer and copying a string
with calls to "tvb_get_string()" (for one thing, "tvb_get_string()"
doesn't require you to remember that the argument to
"tvb_get_nstringz0()" is the size of the buffer into which you're
copying the string, which might be the length of the string to be copied
*plus 1*).
Don't use fixed-length buffers for null-terminated strings (even if the
code that generates those packets has a #define to limit the length of
the string). Use "tvb_get_stringz()", instead.
In some cases where a value is fetched but is only used to pass an
argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()"
instead.
svn path=/trunk/; revision=7859
2003-06-12 08:33:32 +00:00
|
|
|
/*
|
|
|
|
* RFC 3153 (both PPPMuxCP and PPPMux).
|
|
|
|
*/
|
2002-01-03 20:30:33 +00:00
|
|
|
static void
|
|
|
|
dissect_pppmuxcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
dissect_cp(tvb,proto_pppmuxcp,ett_pppmuxcp,pppmuxcp_vals,
|
|
|
|
ett_pppmuxcp_options,pppmuxcp_opts,N_PPPMUXCP_OPTS,pinfo,tree);
|
|
|
|
}
|
|
|
|
|
|
|
|
#define PPPMUX_FLAGS_MASK 0xc0
|
|
|
|
#define PPPMUX_PFF_BIT_SET 0x80
|
|
|
|
#define PPPMUX_LXT_BIT_SET 0x40
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
static void
|
2002-01-03 20:30:33 +00:00
|
|
|
dissect_pppmux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_tree *mux_tree, *hdr_tree, *sub_tree, *flag_tree;
|
|
|
|
proto_tree *info_tree;
|
|
|
|
proto_item *ti = NULL,*sub_ti = NULL;
|
|
|
|
guint8 flags, byte;
|
|
|
|
guint16 length;
|
|
|
|
static guint16 pid;
|
2002-08-28 21:04:11 +00:00
|
|
|
tvbuff_t *next_tvb;
|
2002-01-03 20:30:33 +00:00
|
|
|
int offset = 0, length_remaining;
|
|
|
|
int length_field = 0, pid_field = 0,hdr_length = 0;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-01-03 20:30:33 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
col_set_str(pinfo->cinfo,COL_PROTOCOL, "PPP PPPMux");
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-01-03 20:30:33 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "PPP Multiplexing");
|
2002-08-28 21:04:11 +00:00
|
|
|
|
Allow a length of -1 to be specified when adding FT_NONE and FT_PROTOCOL
items to the protocol tree; it's interpreted as "the rest of the data in
the tvbuff". This can be used if
1) the item covers the entire packet or the remaining payload in
the packet
or
2) the item's length won't be known until it's dissected, and
will be then set with "proto_item_set_len()" - if an
exception is thrown in the dissection, it means the item ran
*past* the end of the tvbuff, so saying it runs to the end of
the tvbuff is reasonable.
Convert a number of "proto_tree_add_XXX()" calls using
"tvb_length_remaining()", values derived from the result of
"tvb_length()", or 0 (in the case of items whose length is unknown) to
use -1 instead (using 0 means that if an exception is thrown, selecting
the item highlights nothing; using -1 means it highlights all the data
for that item that's available).
In some places where "tvb_length()" or "tvb_length_remaining()" was used
to determine how large a packet is, use "tvb_reported_length()" or
"tvb_reported_length_remaining()", instead - the first two calls
indicate how much captured data was in the packet, the latter two calls
indicate how large the packet actually was (and the fact that using the
latter could cause BoundsError exceptions to be thrown is a feature - if
such an exception is thrown, the frame really *was* short, and it should
be tagged as such).
Replace some "proto_tree_add_XXX()" calls with equivalent
"proto_tree_add_item()" calls.
Fix some indentation.
svn path=/trunk/; revision=4578
2002-01-20 22:12:39 +00:00
|
|
|
length_remaining = tvb_reported_length(tvb);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-01-03 20:30:33 +00:00
|
|
|
if (tree) {
|
Allow a length of -1 to be specified when adding FT_NONE and FT_PROTOCOL
items to the protocol tree; it's interpreted as "the rest of the data in
the tvbuff". This can be used if
1) the item covers the entire packet or the remaining payload in
the packet
or
2) the item's length won't be known until it's dissected, and
will be then set with "proto_item_set_len()" - if an
exception is thrown in the dissection, it means the item ran
*past* the end of the tvbuff, so saying it runs to the end of
the tvbuff is reasonable.
Convert a number of "proto_tree_add_XXX()" calls using
"tvb_length_remaining()", values derived from the result of
"tvb_length()", or 0 (in the case of items whose length is unknown) to
use -1 instead (using 0 means that if an exception is thrown, selecting
the item highlights nothing; using -1 means it highlights all the data
for that item that's available).
In some places where "tvb_length()" or "tvb_length_remaining()" was used
to determine how large a packet is, use "tvb_reported_length()" or
"tvb_reported_length_remaining()", instead - the first two calls
indicate how much captured data was in the packet, the latter two calls
indicate how large the packet actually was (and the fact that using the
latter could cause BoundsError exceptions to be thrown is a feature - if
such an exception is thrown, the frame really *was* short, and it should
be tagged as such).
Replace some "proto_tree_add_XXX()" calls with equivalent
"proto_tree_add_item()" calls.
Fix some indentation.
svn path=/trunk/; revision=4578
2002-01-20 22:12:39 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_pppmux, tvb, 0, -1, FALSE);
|
2002-01-03 20:30:33 +00:00
|
|
|
mux_tree = proto_item_add_subtree(ti,ett_pppmux);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-01-03 20:30:33 +00:00
|
|
|
while (length_remaining > 0) {
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-01-03 20:30:33 +00:00
|
|
|
flags = tvb_get_guint8(tvb,offset) & PPPMUX_FLAGS_MASK;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-01-03 20:30:33 +00:00
|
|
|
if (flags && PPPMUX_LXT_BIT_SET ) {
|
|
|
|
length = tvb_get_ntohs(tvb,offset) & 0x3fff;
|
|
|
|
length_field = 2;
|
|
|
|
} else {
|
|
|
|
length = tvb_get_guint8(tvb,offset) & 0x3f;
|
|
|
|
length_field = 1;
|
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-01-03 20:30:33 +00:00
|
|
|
if (flags && PPPMUX_PFF_BIT_SET) {
|
|
|
|
byte = tvb_get_guint8(tvb,offset + length_field);
|
|
|
|
if (byte && PFC_BIT) { /* Compressed PID field*/
|
|
|
|
pid = byte;
|
|
|
|
pid_field = 1;
|
|
|
|
} else { /*PID field is 2 bytes*/
|
|
|
|
pid = tvb_get_ntohs(tvb,offset + length_field);
|
|
|
|
pid_field = 2;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (!pid){ /*No Last PID, hence use the default */
|
2002-08-28 21:04:11 +00:00
|
|
|
if (pppmux_def_prot_id)
|
2002-01-03 20:30:33 +00:00
|
|
|
pid = pppmux_def_prot_id;
|
|
|
|
}
|
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-01-03 20:30:33 +00:00
|
|
|
hdr_length = length_field + pid_field;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-01-03 20:30:33 +00:00
|
|
|
ti = proto_tree_add_text(mux_tree, tvb, offset, length + length_field,
|
|
|
|
"PPPMux Sub-frame");
|
|
|
|
sub_tree = proto_item_add_subtree(ti,ett_pppmux_subframe);
|
|
|
|
sub_ti = proto_tree_add_text(sub_tree, tvb, offset,
|
|
|
|
hdr_length,"Header field");
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-01-03 20:30:33 +00:00
|
|
|
hdr_tree = proto_item_add_subtree(sub_ti,ett_pppmux_subframe_hdr);
|
|
|
|
ti = proto_tree_add_text(hdr_tree, tvb, offset, length_field, "PFF/LXT: 0x%02X",
|
|
|
|
flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-01-03 20:30:33 +00:00
|
|
|
flag_tree = proto_item_add_subtree(ti,ett_pppmux_subframe_flags);
|
|
|
|
proto_tree_add_text(flag_tree,tvb,offset,length_field,"%s",
|
|
|
|
decode_boolean_bitfield(flags,0x80,8,"PID Present","PID not present"));
|
|
|
|
proto_tree_add_text(flag_tree,tvb,offset,length_field,"%s",
|
|
|
|
decode_boolean_bitfield(flags,0x40,8,"2 bytes ength field ","1 byte length field"));
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-01-03 20:30:33 +00:00
|
|
|
ti = proto_tree_add_text(hdr_tree,tvb,offset,length_field,"Sub-frame Length = %u",length);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-01-03 20:30:33 +00:00
|
|
|
if (flags && PPPMUX_PFF_BIT_SET)
|
|
|
|
proto_tree_add_text(hdr_tree,tvb,offset + length_field,pid_field,"%s: %s(0x%02x)",
|
|
|
|
"Protocol ID",val_to_str(pid,ppp_vals,"Unknown"), pid);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-01-03 20:30:33 +00:00
|
|
|
offset += hdr_length;
|
|
|
|
length_remaining -= hdr_length;
|
|
|
|
length -= pid_field;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-01-03 20:30:33 +00:00
|
|
|
sub_ti = proto_tree_add_text(sub_tree,tvb,offset,length,"Information Field");
|
|
|
|
info_tree = proto_item_add_subtree(sub_ti,ett_pppmux_subframe_info);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
|
|
|
next_tvb = tvb_new_subset(tvb,offset,length,-1);
|
|
|
|
|
Instead of tweaking a "Protocol configuration options" extension header
item to look more-or-less like a PPP packet, just dissect it in place
and hand off to the appropriate subdissector using the PPP dissector's
handoff table (which we export, along with its value_string table for
protocol IDs, which we use to report the protocol ID symbolically).
This means there's no point in having a configurable option to control
whether to do that tweaking; make it an obsolete option.
Bring "col_get_writable()" back from the dead, and have the GTP
dissector save the current "writable" flag for columns, mark the columns
non-writable before calling the subdissector for the PPP configuration
protocol, and restore the state of the writable flag, rather than
putting the columns back after the PPP configuration protocol's
dissector is done.
Fix some more typos in comments.
Don't register the IP dissector in the "ppp.protocol" table in the GTP
dissector's handoff registration routine - it's already being done in
the IP dissector's handoff routine.
Fix the name for CHAP to match what RFC 1994 calls it (if the name
changed, it should be changed in all places, but, at least according to
this message, a while ago, from Bob Sutterfield, "since the RFC defines
the protocol, the RFC defines the name":
http://mail-index.netbsd.org/netbsd-help/1996/05/16/0011.html
and the RFC defines the name as "PPP Challenge Handshake Authentication
Protocol (CHAP)").
svn path=/trunk/; revision=6617
2002-11-11 19:23:14 +00:00
|
|
|
if (!dissector_try_port(ppp_subdissector_table, pid, next_tvb, pinfo, info_tree)) {
|
2002-01-03 20:30:33 +00:00
|
|
|
call_dissector(data_handle, next_tvb, pinfo, info_tree);
|
|
|
|
}
|
|
|
|
offset += length;
|
|
|
|
length_remaining -= length;
|
|
|
|
} /* While length_remaining */
|
2002-08-28 21:04:11 +00:00
|
|
|
pid = 0;
|
|
|
|
} /* if tree */
|
2002-01-03 20:30:33 +00:00
|
|
|
}
|
|
|
|
|
Add new routines:
tvb_get_string() - takes a tvbuff, an offset, and a length as
arguments, allocates a buffer big enough to hold a string with
the specified number of bytes plus an added null terminator
(i.e., length+1), copies the specified number of bytes from the
tvbuff, at the specified offset, to that buffer and puts in a
null terminator, and returns a pointer to that buffer (or throws
an exception before allocating the buffer if that many bytes
aren't available in the tvbuff);
tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to
a "gint" as arguments, gets the size of the null-terminated
string starting at the specified offset in the tvbuff (throwing
an exception if the null terminator isn't found), allocates a
buffer big enough to hold that string, copies the string to that
buffer, and returns a pointer to that buffer and stores the
length of the string (including the terminating null) in the
variable pointed to by the "gint" pointer.
Replace many pieces of code allocating a buffer and copying a string
with calls to "tvb_get_string()" (for one thing, "tvb_get_string()"
doesn't require you to remember that the argument to
"tvb_get_nstringz0()" is the size of the buffer into which you're
copying the string, which might be the length of the string to be copied
*plus 1*).
Don't use fixed-length buffers for null-terminated strings (even if the
code that generates those packets has a #define to limit the length of
the string). Use "tvb_get_stringz()", instead.
In some cases where a value is fetched but is only used to pass an
argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()"
instead.
svn path=/trunk/; revision=7859
2003-06-12 08:33:32 +00:00
|
|
|
/*
|
|
|
|
* RFC 3032.
|
|
|
|
*/
|
2002-08-18 15:30:38 +00:00
|
|
|
static void
|
|
|
|
dissect_mplscp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
dissect_cp(tvb, proto_mplscp, ett_mplscp, cp_vals, ett_mplscp_options,
|
|
|
|
NULL, 0, pinfo, tree);
|
|
|
|
}
|
|
|
|
|
Add new routines:
tvb_get_string() - takes a tvbuff, an offset, and a length as
arguments, allocates a buffer big enough to hold a string with
the specified number of bytes plus an added null terminator
(i.e., length+1), copies the specified number of bytes from the
tvbuff, at the specified offset, to that buffer and puts in a
null terminator, and returns a pointer to that buffer (or throws
an exception before allocating the buffer if that many bytes
aren't available in the tvbuff);
tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to
a "gint" as arguments, gets the size of the null-terminated
string starting at the specified offset in the tvbuff (throwing
an exception if the null terminator isn't found), allocates a
buffer big enough to hold that string, copies the string to that
buffer, and returns a pointer to that buffer and stores the
length of the string (including the terminating null) in the
variable pointed to by the "gint" pointer.
Replace many pieces of code allocating a buffer and copying a string
with calls to "tvb_get_string()" (for one thing, "tvb_get_string()"
doesn't require you to remember that the argument to
"tvb_get_nstringz0()" is the size of the buffer into which you're
copying the string, which might be the length of the string to be copied
*plus 1*).
Don't use fixed-length buffers for null-terminated strings (even if the
code that generates those packets has a #define to limit the length of
the string). Use "tvb_get_stringz()", instead.
In some cases where a value is fetched but is only used to pass an
argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()"
instead.
svn path=/trunk/; revision=7859
2003-06-12 08:33:32 +00:00
|
|
|
/*
|
|
|
|
* Cisco Discovery Protocol Control Protocol.
|
|
|
|
* XXX - where is this documented?
|
|
|
|
*/
|
2002-08-18 15:30:38 +00:00
|
|
|
static void
|
|
|
|
dissect_cdpcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
dissect_cp(tvb, proto_cdpcp, ett_cdpcp, cp_vals, ett_cdpcp_options,
|
|
|
|
NULL, 0, pinfo, tree);
|
|
|
|
}
|
2002-01-03 20:30:33 +00:00
|
|
|
|
1999-09-11 04:19:26 +00:00
|
|
|
#define MP_FRAG_MASK 0xC0
|
|
|
|
#define MP_FRAG(bits) ((bits) & MP_FRAG_MASK)
|
|
|
|
#define MP_FRAG_FIRST 0x80
|
|
|
|
#define MP_FRAG_LAST 0x40
|
|
|
|
#define MP_FRAG_RESERVED 0x3f
|
|
|
|
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
static const true_false_string frag_truth = {
|
|
|
|
"Yes",
|
|
|
|
"No"
|
|
|
|
};
|
|
|
|
|
1999-09-11 04:19:26 +00:00
|
|
|
/* According to RFC 1717, the length the MP header isn't indicated anywhere
|
|
|
|
in the header itself. It starts out at four bytes and can be
|
|
|
|
negotiated down to two using LCP. We currently assume that all
|
|
|
|
headers are four bytes. - gcc
|
|
|
|
*/
|
|
|
|
static void
|
2000-05-25 07:42:26 +00:00
|
|
|
dissect_mp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
1999-09-11 04:19:26 +00:00
|
|
|
{
|
2001-03-29 09:18:34 +00:00
|
|
|
proto_tree *mp_tree, *hdr_tree;
|
|
|
|
proto_item *ti = NULL;
|
1999-09-11 04:19:26 +00:00
|
|
|
guint8 flags;
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
gchar *flag_str;
|
|
|
|
tvbuff_t *next_tvb;
|
Add the "Edit:Protocols..." feature which currently only implements
the following:
It is now possible to enable/disable a particular protocol decoding
(i.e. the protocol dissector is void or not). When a protocol
is disabled, it is displayed as Data and of course, all linked
sub-protocols are disabled as well.
Disabling a protocol could be interesting:
- in case of buggy dissectors
- in case of wrong heuristics
- for performance reasons
- to decode the data as another protocol (TODO)
Currently (if I am not wrong), all dissectors but NFS can be disabled
(and dissectors that do not register protocols :-)
I do not like the way the RPC sub-dissectors are disabled (in the
sub-dissectors) since this could be done in the RPC dissector itself,
knowing the sub-protocol hfinfo entry (this is why, I've not modified
the NFS one yet).
Two functions are added in proto.c :
gboolean proto_is_protocol_enabled(int n);
void proto_set_decoding(int n, gboolean enabled);
and two MACROs which can be used in dissectors:
OLD_CHECK_DISPLAY_AS_DATA(index, pd, offset, fd, tree)
CHECK_DISPLAY_AS_DATA(index, tvb, pinfo, tree)
See also the XXX in proto_dlg.c and proto.c around the new functions.
svn path=/trunk/; revision=2267
2000-08-13 14:09:15 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PPP MP");
|
1999-09-11 04:19:26 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "PPP Multilink");
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
|
|
|
|
flags = tvb_get_guint8(tvb, 0);
|
1999-09-11 04:19:26 +00:00
|
|
|
|
|
|
|
if (tree) {
|
|
|
|
switch (flags) {
|
|
|
|
case MP_FRAG_FIRST:
|
2000-05-25 07:42:26 +00:00
|
|
|
flag_str = "First";
|
1999-09-11 04:19:26 +00:00
|
|
|
break;
|
|
|
|
case MP_FRAG_LAST:
|
2000-05-25 07:42:26 +00:00
|
|
|
flag_str = "Last";
|
1999-09-11 04:19:26 +00:00
|
|
|
break;
|
|
|
|
case MP_FRAG_FIRST|MP_FRAG_LAST:
|
2000-05-25 07:42:26 +00:00
|
|
|
flag_str = "First, Last";
|
1999-09-11 04:19:26 +00:00
|
|
|
break;
|
|
|
|
default:
|
2000-05-25 07:42:26 +00:00
|
|
|
flag_str = "Unknown";
|
1999-09-11 04:19:26 +00:00
|
|
|
break;
|
|
|
|
}
|
2000-05-31 05:09:07 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_mp, tvb, 0, 4, FALSE);
|
1999-11-16 11:44:20 +00:00
|
|
|
mp_tree = proto_item_add_subtree(ti, ett_mp);
|
2000-05-25 07:42:26 +00:00
|
|
|
ti = proto_tree_add_text(mp_tree, tvb, 0, 1, "Fragment: 0x%2X (%s)",
|
1999-09-11 04:19:26 +00:00
|
|
|
flags, flag_str);
|
1999-11-16 11:44:20 +00:00
|
|
|
hdr_tree = proto_item_add_subtree(ti, ett_mp_flags);
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
proto_tree_add_boolean(hdr_tree, hf_mp_frag_first, tvb, 0, 1, flags);
|
|
|
|
proto_tree_add_boolean(hdr_tree, hf_mp_frag_last, tvb, 0, 1, flags),
|
2000-05-25 07:42:26 +00:00
|
|
|
proto_tree_add_text(hdr_tree, tvb, 0, 1, "%s",
|
1999-09-11 04:19:26 +00:00
|
|
|
decode_boolean_bitfield(flags, MP_FRAG_RESERVED, sizeof(flags) * 8,
|
|
|
|
"reserved", "reserved"));
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
proto_tree_add_item(mp_tree, hf_mp_sequence_num, tvb, 1, 3, FALSE);
|
|
|
|
}
|
1999-09-11 04:19:26 +00:00
|
|
|
|
2001-03-29 09:18:34 +00:00
|
|
|
if (tvb_reported_length_remaining(tvb, 4) > 0) {
|
|
|
|
next_tvb = tvb_new_subset(tvb, 4, -1, -1);
|
2001-03-30 06:10:54 +00:00
|
|
|
dissect_ppp(next_tvb, pinfo, tree);
|
1999-09-11 04:19:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-03-29 09:18:34 +00:00
|
|
|
/*
|
2001-03-30 06:10:54 +00:00
|
|
|
* Handles PPP without HDLC framing, just a protocol field (RFC 1661).
|
2001-03-29 09:18:34 +00:00
|
|
|
*/
|
2000-11-19 02:00:03 +00:00
|
|
|
static void
|
2001-03-30 06:10:54 +00:00
|
|
|
dissect_ppp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) {
|
2001-03-29 09:18:34 +00:00
|
|
|
proto_item *ti = NULL;
|
1999-08-25 03:56:07 +00:00
|
|
|
proto_tree *fh_tree = NULL;
|
|
|
|
|
|
|
|
if(tree) {
|
Allow a length of -1 to be specified when adding FT_NONE and FT_PROTOCOL
items to the protocol tree; it's interpreted as "the rest of the data in
the tvbuff". This can be used if
1) the item covers the entire packet or the remaining payload in
the packet
or
2) the item's length won't be known until it's dissected, and
will be then set with "proto_item_set_len()" - if an
exception is thrown in the dissection, it means the item ran
*past* the end of the tvbuff, so saying it runs to the end of
the tvbuff is reasonable.
Convert a number of "proto_tree_add_XXX()" calls using
"tvb_length_remaining()", values derived from the result of
"tvb_length()", or 0 (in the case of items whose length is unknown) to
use -1 instead (using 0 means that if an exception is thrown, selecting
the item highlights nothing; using -1 means it highlights all the data
for that item that's available).
In some places where "tvb_length()" or "tvb_length_remaining()" was used
to determine how large a packet is, use "tvb_reported_length()" or
"tvb_reported_length_remaining()", instead - the first two calls
indicate how much captured data was in the packet, the latter two calls
indicate how large the packet actually was (and the fact that using the
latter could cause BoundsError exceptions to be thrown is a feature - if
such an exception is thrown, the frame really *was* short, and it should
be tagged as such).
Replace some "proto_tree_add_XXX()" calls with equivalent
"proto_tree_add_item()" calls.
Fix some indentation.
svn path=/trunk/; revision=4578
2002-01-20 22:12:39 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_ppp, tvb, 0, -1, FALSE);
|
1999-11-16 11:44:20 +00:00
|
|
|
fh_tree = proto_item_add_subtree(ti, ett_ppp);
|
1999-06-11 15:30:55 +00:00
|
|
|
}
|
1999-08-25 03:56:07 +00:00
|
|
|
|
2004-10-30 08:45:10 +00:00
|
|
|
dissect_ppp_common(tvb, pinfo, tree, fh_tree, ti, 0);
|
1999-06-11 15:30:55 +00:00
|
|
|
}
|
|
|
|
|
2004-12-13 10:10:51 +00:00
|
|
|
static void
|
|
|
|
dissect_ppp_hdlc_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *ti = NULL;
|
|
|
|
proto_tree *fh_tree = NULL;
|
|
|
|
guint8 byte0;
|
|
|
|
int proto_offset;
|
|
|
|
tvbuff_t *next_tvb;
|
|
|
|
|
|
|
|
byte0 = tvb_get_guint8(tvb, 0);
|
|
|
|
|
|
|
|
/* PPP HDLC encapsulation */
|
|
|
|
if (byte0 == 0xff)
|
|
|
|
proto_offset = 2;
|
|
|
|
else {
|
|
|
|
/* address and control are compressed (NULL) */
|
|
|
|
proto_offset = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* load the top pane info. This should be overwritten by
|
|
|
|
the next protocol in the stack */
|
|
|
|
if(tree) {
|
|
|
|
ti = proto_tree_add_item(tree, proto_ppp, tvb, 0, -1, FALSE);
|
|
|
|
fh_tree = proto_item_add_subtree(ti, ett_ppp);
|
|
|
|
if (byte0 == 0xff) {
|
|
|
|
proto_tree_add_item(fh_tree, hf_ppp_address, tvb, 0, 1, FALSE);
|
|
|
|
proto_tree_add_item(fh_tree, hf_ppp_control, tvb, 1, 1, FALSE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
next_tvb = decode_fcs(tvb, fh_tree, ppp_fcs_decode, proto_offset);
|
|
|
|
|
|
|
|
dissect_ppp_common(next_tvb, pinfo, tree, fh_tree, ti, proto_offset);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Handles link-layer encapsulations where the frame might be
|
|
|
|
* a PPP in HDLC-like Framing frame (RFC 1662) or a Cisco HDLC frame.
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
dissect_ppp_hdlc( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
|
|
|
|
{
|
|
|
|
guint8 byte0;
|
|
|
|
|
|
|
|
byte0 = tvb_get_guint8(tvb, 0);
|
|
|
|
if (byte0 == CHDLC_ADDR_UNICAST || byte0 == CHDLC_ADDR_MULTICAST) {
|
|
|
|
/* Cisco HDLC encapsulation */
|
|
|
|
call_dissector(chdlc_handle, tvb, pinfo, tree);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XXX - should we have an exported dissector that always dissects PPP,
|
|
|
|
* for use when we know the packets are PPP, not CHDLC?
|
|
|
|
*/
|
|
|
|
if(check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PPP");
|
|
|
|
switch (pinfo->p2p_dir) {
|
|
|
|
|
|
|
|
case P2P_DIR_SENT:
|
|
|
|
if(check_col(pinfo->cinfo, COL_RES_DL_SRC))
|
|
|
|
col_set_str(pinfo->cinfo, COL_RES_DL_SRC, "DTE");
|
|
|
|
if(check_col(pinfo->cinfo, COL_RES_DL_DST))
|
|
|
|
col_set_str(pinfo->cinfo, COL_RES_DL_DST, "DCE");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case P2P_DIR_RECV:
|
|
|
|
if(check_col(pinfo->cinfo, COL_RES_DL_SRC))
|
|
|
|
col_set_str(pinfo->cinfo, COL_RES_DL_SRC, "DCE");
|
|
|
|
if(check_col(pinfo->cinfo, COL_RES_DL_DST))
|
|
|
|
col_set_str(pinfo->cinfo, COL_RES_DL_DST, "DTE");
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
if(check_col(pinfo->cinfo, COL_RES_DL_SRC))
|
|
|
|
col_set_str(pinfo->cinfo, COL_RES_DL_SRC, "N/A");
|
|
|
|
if(check_col(pinfo->cinfo, COL_RES_DL_DST))
|
|
|
|
col_set_str(pinfo->cinfo, COL_RES_DL_DST, "N/A");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
dissect_ppp_hdlc_common(tvb, pinfo, tree);
|
|
|
|
}
|
|
|
|
|
2004-12-12 20:28:18 +00:00
|
|
|
static tvbuff_t*
|
2004-12-13 01:34:35 +00:00
|
|
|
remove_escape_chars(tvbuff_t *tvb, int offset, int length)
|
2004-12-12 20:28:18 +00:00
|
|
|
{
|
|
|
|
guint8 *buff;
|
|
|
|
int i;
|
|
|
|
int scanned_len = 0;
|
|
|
|
guint8 octet;
|
|
|
|
tvbuff_t *next_tvb;
|
|
|
|
|
|
|
|
buff = g_malloc(length);
|
|
|
|
i = 0;
|
|
|
|
while ( scanned_len < length ){
|
|
|
|
octet = tvb_get_guint8(tvb,offset);
|
|
|
|
if (octet == 0x7d){
|
|
|
|
offset++;
|
|
|
|
scanned_len++;
|
2004-12-13 10:10:51 +00:00
|
|
|
if (scanned_len >= length)
|
|
|
|
break;
|
2004-12-12 20:28:18 +00:00
|
|
|
octet = tvb_get_guint8(tvb,offset);
|
|
|
|
buff[i] = octet ^ 0x20;
|
|
|
|
}else{
|
|
|
|
buff[i]= octet;
|
|
|
|
}
|
|
|
|
offset++;
|
|
|
|
scanned_len++;
|
|
|
|
i++;
|
|
|
|
}
|
2004-12-13 10:10:51 +00:00
|
|
|
if (i == 0)
|
|
|
|
return NULL;
|
2004-12-12 20:28:18 +00:00
|
|
|
next_tvb = tvb_new_real_data(buff,i,i);
|
|
|
|
|
|
|
|
/* Arrange that the allocated packet data copy be freed when the
|
|
|
|
* tvbuff is freed.
|
|
|
|
*/
|
|
|
|
tvb_set_free_cb( next_tvb, g_free );
|
|
|
|
|
|
|
|
tvb_set_child_real_data_tvbuff(tvb,next_tvb);
|
|
|
|
return next_tvb;
|
|
|
|
|
|
|
|
}
|
2004-12-13 10:10:51 +00:00
|
|
|
|
2004-12-12 20:28:18 +00:00
|
|
|
/*
|
2004-12-13 10:10:51 +00:00
|
|
|
* Handles link-layer encapsulations where we have a raw RFC 1662
|
|
|
|
* HDLC-like asynchronous framing byte stream, and have to
|
|
|
|
* break the byte stream into frames and remove escapes.
|
2004-12-12 20:28:18 +00:00
|
|
|
*/
|
|
|
|
static void
|
2004-12-13 10:10:51 +00:00
|
|
|
dissect_ppp_raw_hdlc( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
|
2004-12-12 20:28:18 +00:00
|
|
|
{
|
2004-12-13 10:10:51 +00:00
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *bs_tree = NULL;
|
|
|
|
gint offset, end_offset;
|
|
|
|
int length;
|
|
|
|
tvbuff_t *ppp_tvb;
|
|
|
|
gboolean first = TRUE;
|
2004-12-12 20:28:18 +00:00
|
|
|
|
|
|
|
if(check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PPP" );
|
|
|
|
|
2004-12-13 10:10:51 +00:00
|
|
|
if (tree) {
|
|
|
|
ti = proto_tree_add_item(tree, proto_ppp_hdlc, tvb, 0, -1, FALSE);
|
|
|
|
bs_tree = proto_item_add_subtree(ti, ett_ppp_hdlc_data);
|
|
|
|
}
|
2004-12-12 20:28:18 +00:00
|
|
|
|
2004-12-13 10:10:51 +00:00
|
|
|
/*
|
|
|
|
* XXX - this needs to handle a PPP frame split over multiple higher-level
|
|
|
|
* packets.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Look for a frame delimiter.
|
|
|
|
*/
|
|
|
|
offset = tvb_find_guint8(tvb, 0, -1, 0x7e);
|
|
|
|
if (offset == -1) {
|
|
|
|
/*
|
|
|
|
* None found - this is presumably continued from an earlier
|
|
|
|
* packet and continued in a later packet.
|
|
|
|
*/
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)){
|
|
|
|
col_add_str(pinfo->cinfo, COL_INFO,"PPP Fragment");
|
|
|
|
}
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(bs_tree, tvb, offset, -1, "PPP Fragment");
|
2004-12-12 20:28:18 +00:00
|
|
|
offset++;
|
2004-12-13 10:10:51 +00:00
|
|
|
length = tvb_length_remaining(tvb,offset);
|
|
|
|
ppp_tvb = remove_escape_chars(tvb, offset,length);
|
|
|
|
if (ppp_tvb != NULL) {
|
2004-12-12 20:28:18 +00:00
|
|
|
add_new_data_source(pinfo, ppp_tvb, "PPP Fragment");
|
|
|
|
call_dissector(data_handle, ppp_tvb, pinfo, tree);
|
|
|
|
}
|
2004-12-13 10:10:51 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (offset != 0) {
|
|
|
|
/*
|
|
|
|
* We have some data preceding the first PPP packet;
|
|
|
|
* mark it as a PPP fragment.
|
|
|
|
*/
|
|
|
|
if(check_col(pinfo->cinfo, COL_INFO)){
|
|
|
|
col_add_str(pinfo->cinfo, COL_INFO,"PPP Fragment");
|
|
|
|
}
|
|
|
|
length = offset;
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(bs_tree, tvb, 0, length, "PPP Fragment");
|
|
|
|
if (length != 0) {
|
|
|
|
ppp_tvb = remove_escape_chars(tvb, 0, length - 1);
|
|
|
|
if (ppp_tvb != NULL) {
|
|
|
|
add_new_data_source(pinfo, ppp_tvb, "PPP Fragment");
|
|
|
|
call_dissector(data_handle, ppp_tvb, pinfo, tree);
|
2004-12-12 20:28:18 +00:00
|
|
|
}
|
2004-12-13 10:10:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
while ( tvb_reported_length_remaining(tvb, offset) > 0 ){
|
|
|
|
/*
|
|
|
|
* Look for the next frame delimiter.
|
|
|
|
*/
|
|
|
|
end_offset = tvb_find_guint8(tvb, offset+1, -1, 0x7e);
|
|
|
|
if ( end_offset == -1 ){
|
|
|
|
/*
|
|
|
|
* We didn't find one. This is probably continued in
|
|
|
|
* a later packet.
|
|
|
|
*/
|
|
|
|
if (first) {
|
|
|
|
if(check_col(pinfo->cinfo, COL_INFO)){
|
|
|
|
col_add_str(pinfo->cinfo, COL_INFO,"PPP Fragment");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(bs_tree, tvb, offset, -1, "PPP Fragment");
|
|
|
|
offset++;
|
|
|
|
length = tvb_length_remaining(tvb, offset);
|
2004-12-13 01:34:35 +00:00
|
|
|
ppp_tvb = remove_escape_chars(tvb, offset,length);
|
2004-12-13 10:10:51 +00:00
|
|
|
if (ppp_tvb != NULL) {
|
|
|
|
add_new_data_source(pinfo, ppp_tvb, "PPP Fragment");
|
|
|
|
call_dissector(data_handle, ppp_tvb, pinfo, tree);
|
|
|
|
}
|
2004-12-12 20:28:18 +00:00
|
|
|
return;
|
|
|
|
}
|
2004-12-13 10:10:51 +00:00
|
|
|
length = end_offset - offset;
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(bs_tree, tvb, offset, length, "PPP Data");
|
|
|
|
if (length > 1) {
|
|
|
|
ppp_tvb = remove_escape_chars(tvb, offset + 1, length - 1);
|
|
|
|
if (ppp_tvb != NULL) {
|
|
|
|
add_new_data_source(pinfo, ppp_tvb, "PPP Message");
|
|
|
|
dissect_ppp_hdlc_common(ppp_tvb, pinfo, tree);
|
|
|
|
first = FALSE;
|
|
|
|
}
|
2004-12-12 20:28:18 +00:00
|
|
|
}
|
2004-12-13 10:10:51 +00:00
|
|
|
offset = end_offset;
|
2004-12-12 20:28:18 +00:00
|
|
|
} /* end while */
|
|
|
|
}
|
|
|
|
|
2004-12-13 10:10:51 +00:00
|
|
|
void
|
|
|
|
proto_register_ppp_raw_hdlc(void)
|
2002-05-20 00:56:30 +00:00
|
|
|
{
|
2004-12-13 10:10:51 +00:00
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_ppp_hdlc_data
|
|
|
|
};
|
2003-01-06 22:33:57 +00:00
|
|
|
|
2004-12-13 10:10:51 +00:00
|
|
|
proto_ppp_hdlc = proto_register_protocol("PPP In HDLC-Like Framing", "PPP-HDLC", "ppp_hdlc");
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2004-12-13 10:10:51 +00:00
|
|
|
void
|
|
|
|
proto_reg_handoff_ppp_raw_hdlc(void)
|
|
|
|
{
|
|
|
|
dissector_handle_t ppp_raw_hdlc_handle;
|
2002-05-20 00:56:30 +00:00
|
|
|
|
2004-12-13 10:10:51 +00:00
|
|
|
ppp_raw_hdlc_handle = create_dissector_handle(dissect_ppp_raw_hdlc, proto_ppp);
|
|
|
|
dissector_add("gre.proto", ETHERTYPE_CDMA2000_A10_UBS, ppp_raw_hdlc_handle);
|
1998-09-16 02:39:15 +00:00
|
|
|
}
|
1999-07-29 05:47:07 +00:00
|
|
|
|
2001-06-15 20:35:08 +00:00
|
|
|
/*
|
|
|
|
* Handles PAP just as a protocol field
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
dissect_pap( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) {
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *fh_tree = NULL;
|
|
|
|
proto_item *tf;
|
|
|
|
proto_tree *field_tree;
|
|
|
|
proto_item *tm;
|
|
|
|
proto_tree *message_tree;
|
|
|
|
proto_item *tp;
|
|
|
|
proto_tree *peer_id_tree;
|
|
|
|
proto_item *tpw;
|
|
|
|
proto_tree *passwd_tree;
|
|
|
|
|
|
|
|
guint8 code;
|
|
|
|
guint8 id, peer_id_length, password_length, msg_length;
|
|
|
|
int length, offset;
|
|
|
|
|
|
|
|
code = tvb_get_guint8(tvb, 0);
|
|
|
|
id = tvb_get_guint8(tvb, 1);
|
|
|
|
length = tvb_get_ntohs(tvb, 2);
|
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_PROTOCOL))
|
2003-11-16 23:17:27 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PPP PAP");
|
2001-06-16 00:51:45 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO))
|
2003-11-16 23:17:27 +00:00
|
|
|
col_add_str(pinfo->cinfo, COL_INFO,
|
2001-06-15 20:35:08 +00:00
|
|
|
val_to_str(code, pap_vals, "Unknown"));
|
|
|
|
|
|
|
|
if(tree) {
|
|
|
|
ti = proto_tree_add_item(tree, proto_pap, tvb, 0, length, FALSE);
|
|
|
|
fh_tree = proto_item_add_subtree(ti, ett_pap);
|
|
|
|
proto_tree_add_text(fh_tree, tvb, 0, 1, "Code: %s (0x%02x)",
|
|
|
|
val_to_str(code, pap_vals, "Unknown"), code);
|
|
|
|
proto_tree_add_text(fh_tree, tvb, 1, 1, "Identifier: 0x%02x",
|
|
|
|
id);
|
|
|
|
proto_tree_add_text(fh_tree, tvb, 2, 2, "Length: %u",
|
|
|
|
length);
|
|
|
|
}
|
|
|
|
offset = 4;
|
|
|
|
length -= 4;
|
|
|
|
|
|
|
|
switch (code) {
|
|
|
|
case CONFREQ:
|
|
|
|
if(tree) {
|
|
|
|
if (length > 0) {
|
|
|
|
tf = proto_tree_add_text(fh_tree, tvb, offset, length,
|
2001-12-08 01:03:19 +00:00
|
|
|
"Data (%d byte%s)", length, plurality(length, "", "s"));
|
2001-06-15 20:35:08 +00:00
|
|
|
field_tree = proto_item_add_subtree(tf, ett_pap_data);
|
|
|
|
peer_id_length = tvb_get_guint8(tvb, offset);
|
|
|
|
tp = proto_tree_add_text(field_tree, tvb, offset, 1,
|
|
|
|
"Peer ID length: %d byte%s", peer_id_length, plurality(peer_id_length, "", "s"));
|
|
|
|
if (--length > 0) {
|
|
|
|
peer_id_tree = proto_item_add_subtree(tp, ett_pap_peer_id);
|
|
|
|
proto_tree_add_text(peer_id_tree, tvb, ++offset, ppp_min(peer_id_length, length),
|
|
|
|
"Peer-ID (%d byte%s)", peer_id_length, plurality(peer_id_length, "", "s"));
|
|
|
|
offset+=peer_id_length;
|
|
|
|
length-=peer_id_length;
|
|
|
|
if (length > 0) {
|
|
|
|
password_length = tvb_get_guint8(tvb, offset);
|
|
|
|
if (--length > 0) {
|
|
|
|
tpw = proto_tree_add_text(field_tree, tvb, offset, 1,
|
|
|
|
"Password length: %d byte%s", password_length, plurality(password_length, "", "s"));
|
|
|
|
passwd_tree = proto_item_add_subtree(tpw, ett_pap_password);
|
|
|
|
proto_tree_add_text(passwd_tree, tvb, ++offset, ppp_min(password_length, length),
|
|
|
|
"Password (%d byte%s)", password_length, plurality(password_length, "", "s"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CONFACK:
|
|
|
|
case CONFNAK:
|
|
|
|
if(tree) {
|
|
|
|
if (length > 0) {
|
|
|
|
tf = proto_tree_add_text(fh_tree, tvb, offset, length,
|
2001-12-08 01:03:19 +00:00
|
|
|
"Data (%d byte%s)", length, plurality(length, "", "s"));
|
2001-06-15 20:35:08 +00:00
|
|
|
field_tree = proto_item_add_subtree(tf, ett_pap_data);
|
|
|
|
msg_length = tvb_get_guint8(tvb, offset);
|
|
|
|
tm = proto_tree_add_text(field_tree, tvb, offset, 1,
|
|
|
|
"Message length: %d byte%s", msg_length, plurality(msg_length, "", "s"));
|
|
|
|
if (--length > 0) {
|
|
|
|
message_tree = proto_item_add_subtree(tm, ett_pap_message);
|
|
|
|
proto_tree_add_text(message_tree, tvb, ++offset, ppp_min(msg_length, length),
|
|
|
|
"Message (%d byte%s)", msg_length, plurality(msg_length, "", "s"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if (length > 0)
|
|
|
|
proto_tree_add_text(fh_tree, tvb, offset, length, "Stuff (%d byte%s)",
|
|
|
|
length, plurality(length, "", "s"));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-09-30 13:30:51 +00:00
|
|
|
/*
|
|
|
|
* Handles CHAP just as a protocol field
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
dissect_chap( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) {
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *fh_tree = NULL;
|
|
|
|
proto_item *tf;
|
|
|
|
proto_tree *field_tree;
|
|
|
|
proto_item *tv;
|
|
|
|
proto_tree *value_tree;
|
|
|
|
|
|
|
|
guint8 code, id, value_size;
|
|
|
|
guint16 length;
|
|
|
|
int offset;
|
|
|
|
int name_length;
|
|
|
|
|
|
|
|
code = tvb_get_guint8(tvb, 0);
|
|
|
|
id = tvb_get_guint8(tvb, 1);
|
|
|
|
length = tvb_get_ntohs(tvb, 2);
|
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_PROTOCOL))
|
2003-11-16 23:17:27 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PPP CHAP");
|
2001-09-30 13:30:51 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO))
|
2003-11-16 23:17:27 +00:00
|
|
|
col_add_str(pinfo->cinfo, COL_INFO,
|
2001-09-30 13:30:51 +00:00
|
|
|
val_to_str(code, chap_vals, "Unknown"));
|
|
|
|
|
|
|
|
if(tree) {
|
|
|
|
ti = proto_tree_add_item(tree, proto_chap, tvb, 0, length, FALSE);
|
|
|
|
fh_tree = proto_item_add_subtree(ti, ett_chap);
|
|
|
|
proto_tree_add_text(fh_tree, tvb, 0, 1, "Code: %s (0x%02x)",
|
|
|
|
val_to_str(code, chap_vals, "Unknown"), code);
|
|
|
|
proto_tree_add_text(fh_tree, tvb, 1, 1, "Identifier: 0x%02x",
|
|
|
|
id);
|
|
|
|
proto_tree_add_text(fh_tree, tvb, 2, 2, "Length: %u",
|
|
|
|
length);
|
|
|
|
}
|
|
|
|
offset = 4;
|
|
|
|
length -= 4;
|
|
|
|
|
|
|
|
switch (code) {
|
|
|
|
case CHAP_CHAL:
|
|
|
|
case CHAP_RESP:
|
|
|
|
if(tree) {
|
|
|
|
if (length > 0) {
|
|
|
|
tf = proto_tree_add_text(fh_tree, tvb, offset, length,
|
2002-08-28 21:04:11 +00:00
|
|
|
"Data (%d byte%s)", length,
|
2001-09-30 13:30:51 +00:00
|
|
|
plurality(length, "", "s"));
|
|
|
|
field_tree = proto_item_add_subtree(tf, ett_chap_data);
|
|
|
|
value_size = tvb_get_guint8(tvb, offset);
|
2002-08-28 21:04:11 +00:00
|
|
|
name_length = length - value_size - 1;
|
2001-09-30 13:30:51 +00:00
|
|
|
tv = proto_tree_add_text(field_tree, tvb, offset, 1,
|
2002-08-28 21:04:11 +00:00
|
|
|
"Value Size: %d byte%s",
|
2001-09-30 13:30:51 +00:00
|
|
|
value_size, plurality(value_size, "", "s"));
|
|
|
|
if (--length > 0) {
|
|
|
|
value_tree = proto_item_add_subtree(tv, ett_chap_value);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_text(value_tree, tvb, ++offset,
|
2001-09-30 13:30:51 +00:00
|
|
|
ppp_min(value_size, length),
|
2002-08-28 21:04:11 +00:00
|
|
|
"Value (%d byte%s)",
|
2001-09-30 13:30:51 +00:00
|
|
|
value_size, plurality(value_size, "", "s"));
|
|
|
|
offset+=value_size;
|
|
|
|
length-=value_size;
|
|
|
|
if (length > 0) {
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_text(field_tree, tvb, offset,
|
2001-09-30 13:30:51 +00:00
|
|
|
ppp_min(name_length, length),
|
2002-08-28 21:04:11 +00:00
|
|
|
"Name (%d byte%s)", name_length,
|
2001-09-30 13:30:51 +00:00
|
|
|
plurality(name_length, "", "s"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CHAP_SUCC:
|
|
|
|
case CHAP_FAIL:
|
|
|
|
if(tree) {
|
|
|
|
if (length > 0) {
|
|
|
|
tf = proto_tree_add_text(fh_tree, tvb, offset, length,
|
2002-08-28 21:04:11 +00:00
|
|
|
"Data (%d byte%s)", length,
|
2001-09-30 13:30:51 +00:00
|
|
|
plurality(length, "", "s"));
|
|
|
|
field_tree = proto_item_add_subtree(tf, ett_chap_data);
|
|
|
|
tv = proto_tree_add_text(field_tree, tvb, offset, length,
|
2002-08-28 21:04:11 +00:00
|
|
|
"Message: %d byte%s",
|
2001-09-30 13:30:51 +00:00
|
|
|
length, plurality(length, "", "s"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if (length > 0)
|
|
|
|
proto_tree_add_text(fh_tree, tvb, offset, length, "Stuff (%d byte%s)",
|
|
|
|
length, plurality(length, "", "s"));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Add new routines:
tvb_get_string() - takes a tvbuff, an offset, and a length as
arguments, allocates a buffer big enough to hold a string with
the specified number of bytes plus an added null terminator
(i.e., length+1), copies the specified number of bytes from the
tvbuff, at the specified offset, to that buffer and puts in a
null terminator, and returns a pointer to that buffer (or throws
an exception before allocating the buffer if that many bytes
aren't available in the tvbuff);
tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to
a "gint" as arguments, gets the size of the null-terminated
string starting at the specified offset in the tvbuff (throwing
an exception if the null terminator isn't found), allocates a
buffer big enough to hold that string, copies the string to that
buffer, and returns a pointer to that buffer and stores the
length of the string (including the terminating null) in the
variable pointed to by the "gint" pointer.
Replace many pieces of code allocating a buffer and copying a string
with calls to "tvb_get_string()" (for one thing, "tvb_get_string()"
doesn't require you to remember that the argument to
"tvb_get_nstringz0()" is the size of the buffer into which you're
copying the string, which might be the length of the string to be copied
*plus 1*).
Don't use fixed-length buffers for null-terminated strings (even if the
code that generates those packets has a #define to limit the length of
the string). Use "tvb_get_stringz()", instead.
In some cases where a value is fetched but is only used to pass an
argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()"
instead.
svn path=/trunk/; revision=7859
2003-06-12 08:33:32 +00:00
|
|
|
/*
|
|
|
|
* RFC 2472.
|
|
|
|
*/
|
2002-10-14 23:23:20 +00:00
|
|
|
static void
|
|
|
|
dissect_ipv6cp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
dissect_cp(tvb, proto_ipv6cp, ett_ipv6cp, cp_vals, ett_ipv6cp_options,
|
|
|
|
ipv6cp_opts, N_IPV6CP_OPTS, pinfo, tree);
|
|
|
|
}
|
|
|
|
|
2003-02-07 20:09:33 +00:00
|
|
|
static void dissect_ipv6cp_if_id_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
2002-10-14 23:23:20 +00:00
|
|
|
int offset, guint length, packet_info *pinfo _U_,
|
|
|
|
proto_tree *tree)
|
|
|
|
{
|
2003-02-07 20:09:33 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset, length, "%s: %02x%02x:%02x%02x:%02x%x:%02x%02x",
|
2002-10-14 23:23:20 +00:00
|
|
|
optp->name,
|
|
|
|
tvb_get_guint8(tvb, offset + 2),
|
|
|
|
tvb_get_guint8(tvb, offset + 3),
|
|
|
|
tvb_get_guint8(tvb, offset + 4),
|
|
|
|
tvb_get_guint8(tvb, offset + 5),
|
|
|
|
tvb_get_guint8(tvb, offset + 6),
|
|
|
|
tvb_get_guint8(tvb, offset + 7),
|
|
|
|
tvb_get_guint8(tvb, offset + 8),
|
|
|
|
tvb_get_guint8(tvb, offset + 9)
|
|
|
|
);
|
|
|
|
}
|
2001-09-30 13:30:51 +00:00
|
|
|
|
1999-07-29 05:47:07 +00:00
|
|
|
void
|
|
|
|
proto_register_ppp(void)
|
|
|
|
{
|
2001-12-20 06:22:24 +00:00
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_ppp_address,
|
|
|
|
{ "Address", "ppp.address", FT_UINT8, BASE_HEX,
|
|
|
|
NULL, 0x0, "", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_ppp_control,
|
|
|
|
{ "Control", "ppp.control", FT_UINT8, BASE_HEX,
|
|
|
|
NULL, 0x0, "", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_ppp_protocol,
|
|
|
|
{ "Protocol", "ppp.protocol", FT_UINT16, BASE_HEX,
|
|
|
|
VALS(ppp_vals), 0x0, "", HFILL }},
|
|
|
|
};
|
|
|
|
static gint *ett[] = {
|
2004-12-13 10:10:51 +00:00
|
|
|
&ett_ppp
|
2001-12-20 06:22:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
module_t *ppp_module;
|
|
|
|
|
|
|
|
proto_ppp = proto_register_protocol("Point-to-Point Protocol", "PPP", "ppp");
|
|
|
|
proto_register_field_array(proto_ppp, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2000-04-16 21:37:07 +00:00
|
|
|
|
|
|
|
/* subdissector code */
|
Instead of tweaking a "Protocol configuration options" extension header
item to look more-or-less like a PPP packet, just dissect it in place
and hand off to the appropriate subdissector using the PPP dissector's
handoff table (which we export, along with its value_string table for
protocol IDs, which we use to report the protocol ID symbolically).
This means there's no point in having a configurable option to control
whether to do that tweaking; make it an obsolete option.
Bring "col_get_writable()" back from the dead, and have the GTP
dissector save the current "writable" flag for columns, mark the columns
non-writable before calling the subdissector for the PPP configuration
protocol, and restore the state of the writable flag, rather than
putting the columns back after the PPP configuration protocol's
dissector is done.
Fix some more typos in comments.
Don't register the IP dissector in the "ppp.protocol" table in the GTP
dissector's handoff registration routine - it's already being done in
the IP dissector's handoff routine.
Fix the name for CHAP to match what RFC 1994 calls it (if the name
changed, it should be changed in all places, but, at least according to
this message, a while ago, from Bob Sutterfield, "since the RFC defines
the protocol, the RFC defines the name":
http://mail-index.netbsd.org/netbsd-help/1996/05/16/0011.html
and the RFC defines the name as "PPP Challenge Handshake Authentication
Protocol (CHAP)").
svn path=/trunk/; revision=6617
2002-11-11 19:23:14 +00:00
|
|
|
ppp_subdissector_table = register_dissector_table("ppp.protocol",
|
2001-12-20 06:22:24 +00:00
|
|
|
"PPP protocol", FT_UINT16, BASE_HEX);
|
|
|
|
|
|
|
|
register_dissector("ppp_hdlc", dissect_ppp_hdlc, proto_ppp);
|
2002-12-11 19:59:08 +00:00
|
|
|
register_dissector("ppp_lcp_options", dissect_lcp_options, proto_ppp);
|
2001-12-20 06:22:24 +00:00
|
|
|
register_dissector("ppp", dissect_ppp, proto_ppp);
|
|
|
|
|
|
|
|
/* Register the preferences for the ppp protocol */
|
|
|
|
ppp_module = prefs_register_protocol(proto_ppp, NULL);
|
|
|
|
|
|
|
|
prefs_register_enum_preference(ppp_module,
|
2003-01-28 23:56:40 +00:00
|
|
|
"fcs_type",
|
|
|
|
"PPP Frame Checksum Type",
|
|
|
|
"The type of PPP frame checksum (none, 16-bit, 32-bit)",
|
|
|
|
&ppp_fcs_decode,
|
2003-08-26 05:52:53 +00:00
|
|
|
fcs_options, FALSE);
|
2001-12-20 06:22:24 +00:00
|
|
|
prefs_register_bool_preference(ppp_module,
|
2003-01-28 23:56:40 +00:00
|
|
|
"decompress_vj",
|
|
|
|
"Decompress Van Jacobson-compressed frames",
|
|
|
|
"Whether Van Jacobson-compressed PPP frames should be decompressed",
|
|
|
|
&ppp_vj_decomp);
|
|
|
|
prefs_register_uint_preference(ppp_module,
|
|
|
|
"default_proto_id",
|
|
|
|
"PPPMuxCP Default PID",
|
|
|
|
"Default Protocol ID to be used for PPPMuxCP",
|
|
|
|
16, &pppmux_def_prot_id);
|
1999-07-29 05:47:07 +00:00
|
|
|
}
|
1999-09-11 04:19:26 +00:00
|
|
|
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
void
|
|
|
|
proto_reg_handoff_ppp(void)
|
|
|
|
{
|
2004-12-13 10:10:51 +00:00
|
|
|
dissector_handle_t ppp_hdlc_handle, ppp_handle;
|
2001-12-03 04:00:26 +00:00
|
|
|
|
Add a new Wiretap encapsulation type for Cisco HDLC. Map the NetBSD
DLT_HDLC to it.
Make a separate dissector for Cisco HDLC, and add a dissector for Cisco
SLARP. Have the PPP dissector call the Cisco HDLC dissector if the
address field is the Cisco HDLC unicast or multicast address. Use the
Cisco HDLC dissector for the Cisco HDLC Wiretap encapsulation type.
Add a new dissector table "chdlctype", for Cisco HDLC packet types
(they're *almost* the same as Ethernet types, but 0x8035 is SLARP, not
Reverse ARP, and 0x2000 is the Cisco Discovery protocol, for example),
replacing "fr.chdlc".
Have a "chdlctype()" routine, similar to "ethertype()", used both by the
Cisco HDLC and Frame Relay dissectors. Have a "chdlc_vals[]"
"value_string" table for Cisco HDLC types and protocol names. Split the
packet type field in the Frame Relay dissector into separate SNAP and
Cisco HDLC fields, and give them the Ethernet type and Cisco HDLC type
"value_string" tables, respectively.
svn path=/trunk/; revision=3133
2001-03-15 09:11:03 +00:00
|
|
|
/*
|
|
|
|
* Get a handle for the CHDLC dissector.
|
|
|
|
*/
|
|
|
|
chdlc_handle = find_dissector("chdlc");
|
2001-11-25 22:51:14 +00:00
|
|
|
data_handle = find_dissector("data");
|
Add a new Wiretap encapsulation type for Cisco HDLC. Map the NetBSD
DLT_HDLC to it.
Make a separate dissector for Cisco HDLC, and add a dissector for Cisco
SLARP. Have the PPP dissector call the Cisco HDLC dissector if the
address field is the Cisco HDLC unicast or multicast address. Use the
Cisco HDLC dissector for the Cisco HDLC Wiretap encapsulation type.
Add a new dissector table "chdlctype", for Cisco HDLC packet types
(they're *almost* the same as Ethernet types, but 0x8035 is SLARP, not
Reverse ARP, and 0x2000 is the Cisco Discovery protocol, for example),
replacing "fr.chdlc".
Have a "chdlctype()" routine, similar to "ethertype()", used both by the
Cisco HDLC and Frame Relay dissectors. Have a "chdlc_vals[]"
"value_string" table for Cisco HDLC types and protocol names. Split the
packet type field in the Frame Relay dissector into separate SNAP and
Cisco HDLC fields, and give them the Ethernet type and Cisco HDLC type
"value_string" tables, respectively.
svn path=/trunk/; revision=3133
2001-03-15 09:11:03 +00:00
|
|
|
|
2001-12-03 04:00:26 +00:00
|
|
|
ppp_handle = find_dissector("ppp");
|
2004-12-13 10:10:51 +00:00
|
|
|
dissector_add("fr.ietf", NLPID_PPP, ppp_handle);
|
|
|
|
|
|
|
|
ppp_hdlc_handle = find_dissector("ppp_hdlc");
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_add("wtap_encap", WTAP_ENCAP_PPP, ppp_hdlc_handle);
|
|
|
|
dissector_add("wtap_encap", WTAP_ENCAP_PPP_WITH_PHDR, ppp_hdlc_handle);
|
|
|
|
dissector_add("gre.proto", ETHERTYPE_PPP, ppp_hdlc_handle);
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
}
|
|
|
|
|
1999-09-11 04:19:26 +00:00
|
|
|
void
|
|
|
|
proto_register_mp(void)
|
|
|
|
{
|
1999-09-11 22:40:30 +00:00
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_mp_frag_first,
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
{ "First fragment", "mp.first", FT_BOOLEAN, 8,
|
2001-06-18 02:18:27 +00:00
|
|
|
TFS(&frag_truth), MP_FRAG_FIRST, "", HFILL }},
|
1999-09-11 22:40:30 +00:00
|
|
|
|
|
|
|
{ &hf_mp_frag_last,
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
{ "Last fragment", "mp.last", FT_BOOLEAN, 8,
|
2001-06-18 02:18:27 +00:00
|
|
|
TFS(&frag_truth), MP_FRAG_LAST, "", HFILL }},
|
1999-09-11 22:40:30 +00:00
|
|
|
|
|
|
|
{ &hf_mp_sequence_num,
|
2000-01-29 04:47:34 +00:00
|
|
|
{ "Sequence number", "mp.seq", FT_UINT24, BASE_DEC, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }}
|
1999-09-11 22:40:30 +00:00
|
|
|
};
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_mp,
|
|
|
|
&ett_mp_flags,
|
|
|
|
};
|
1999-09-11 22:40:30 +00:00
|
|
|
|
2001-01-03 06:56:03 +00:00
|
|
|
proto_mp = proto_register_protocol("PPP Multilink Protocol", "PPP MP", "mp");
|
1999-09-11 22:40:30 +00:00
|
|
|
proto_register_field_array(proto_mp, hf, array_length(hf));
|
1999-11-16 11:44:20 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
1999-09-11 04:19:26 +00:00
|
|
|
}
|
2000-11-29 05:16:15 +00:00
|
|
|
|
|
|
|
void
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
proto_reg_handoff_mp(void)
|
2000-11-29 05:16:15 +00:00
|
|
|
{
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t mp_handle;
|
|
|
|
|
|
|
|
mp_handle = create_dissector_handle(dissect_mp, proto_mp);
|
|
|
|
dissector_add("ppp.protocol", PPP_MP, mp_handle);
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_lcp(void)
|
|
|
|
{
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_lcp,
|
|
|
|
&ett_lcp_options,
|
|
|
|
&ett_lcp_authprot_opt,
|
|
|
|
&ett_lcp_qualprot_opt,
|
|
|
|
&ett_lcp_fcs_alternatives_opt,
|
|
|
|
&ett_lcp_numbered_mode_opt,
|
|
|
|
&ett_lcp_callback_opt,
|
|
|
|
&ett_lcp_multilink_ep_disc_opt,
|
|
|
|
&ett_lcp_internationalization_opt,
|
|
|
|
};
|
|
|
|
|
|
|
|
proto_lcp = proto_register_protocol("PPP Link Control Protocol", "PPP LCP",
|
|
|
|
"lcp");
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_lcp(void)
|
|
|
|
{
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t lcp_handle;
|
|
|
|
|
|
|
|
lcp_handle = create_dissector_handle(dissect_lcp, proto_lcp);
|
|
|
|
dissector_add("ppp.protocol", PPP_LCP, lcp_handle);
|
2001-06-15 20:23:41 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* NDISWAN on Windows translates Ethernet frames from higher-level
|
|
|
|
* protocols into PPP frames to hand to the PPP driver, and translates
|
|
|
|
* PPP frames from the PPP driver to hand to the higher-level protocols.
|
|
|
|
*
|
|
|
|
* Apparently the PPP driver, on at least some versions of Windows,
|
|
|
|
* passes frames for internal-to-PPP protocols up through NDISWAN;
|
|
|
|
* the protocol type field appears to be passed through unchanged
|
|
|
|
* (unlike what's done with, for example, the protocol type field
|
|
|
|
* for IP, which is mapped from its PPP value to its Ethernet value).
|
|
|
|
*
|
|
|
|
* This means that we may see, on Ethernet captures, frames for
|
|
|
|
* protocols internal to PPP, so we register PPP_LCP with the
|
|
|
|
* "ethertype" dissector table as well as the PPP protocol dissector
|
|
|
|
* table.
|
|
|
|
*/
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_add("ethertype", PPP_LCP, lcp_handle);
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_ipcp(void)
|
|
|
|
{
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_ipcp,
|
|
|
|
&ett_ipcp_options,
|
|
|
|
&ett_ipcp_ipaddrs_opt,
|
2004-11-22 02:12:43 +00:00
|
|
|
&ett_ipcp_compress_opt,
|
Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to set
"pinfo->current_proto"; dissectors called only through dissector tables
and handles don't need to do either of those, as the dissector table and
handle code will do it for them. (Dissectors called directly, or
dissectors that can be attached to conversations, still have to do it
themselves.)
Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP
IP Control Protocol as official protocols, and register them in PPP's
dissector table rather than having PPP handle them specially; change
"dissect_cp()" to take a protocol ID, get the protocol short name
information from it, and use the protocol ID for the top-level protocol
tree item.
Set the Protocol column in the PPP Multilink Protocol dissector, and set
the Info column before extracting anything from the frame, so that if an
exception is thrown, the Info and Protocol columns will reflect that the
packet is supposed to be a PPP Multilink Protocol frame.
Make the "First fragment" and "Last fragment" flags in the PPP Multilink
Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do
all the heavy lifting when displaying them, rather than doing it by
hand.
Don't extract the sequence number in the PPP Multilink Protocol until
you're ready to put it into the tree, just in case the captured packet
includes the flags but not the sequence number.
Clean up the code to check the FCS of PPP frames - extract it with
"tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte
and then put it together yourself.
svn path=/trunk/; revision=2926
2001-01-21 22:10:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
proto_ipcp = proto_register_protocol("PPP IP Control Protocol", "PPP IPCP",
|
|
|
|
"ipcp");
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_ipcp(void)
|
|
|
|
{
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t ipcp_handle;
|
|
|
|
|
|
|
|
ipcp_handle = create_dissector_handle(dissect_ipcp, proto_ipcp);
|
|
|
|
dissector_add("ppp.protocol", PPP_IPCP, ipcp_handle);
|
2001-06-15 20:23:41 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* See above comment about NDISWAN for an explanation of why we're
|
|
|
|
* registering with the "ethertype" dissector table.
|
|
|
|
*/
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_add("ethertype", PPP_IPCP, ipcp_handle);
|
2000-11-29 05:16:15 +00:00
|
|
|
}
|
2001-06-15 20:35:08 +00:00
|
|
|
|
2004-04-29 20:21:28 +00:00
|
|
|
void
|
|
|
|
proto_register_osicp(void)
|
|
|
|
{
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_osicp,
|
|
|
|
&ett_osicp_options,
|
|
|
|
&ett_osicp_align_npdu_opt,
|
|
|
|
};
|
|
|
|
|
|
|
|
proto_osicp = proto_register_protocol("PPP OSI Control Protocol", "PPP OSICP",
|
|
|
|
"osicp");
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_osicp(void)
|
|
|
|
{
|
|
|
|
dissector_handle_t osicp_handle;
|
|
|
|
|
|
|
|
osicp_handle = create_dissector_handle(dissect_osicp, proto_osicp);
|
|
|
|
dissector_add("ppp.protocol", PPP_OSICP, osicp_handle);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* See above comment about NDISWAN for an explanation of why we're
|
|
|
|
* registering with the "ethertype" dissector table.
|
|
|
|
*/
|
|
|
|
dissector_add("ethertype", PPP_OSICP, osicp_handle);
|
|
|
|
}
|
|
|
|
|
2001-10-29 19:48:45 +00:00
|
|
|
void
|
|
|
|
proto_register_ccp(void)
|
|
|
|
{
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_ccp,
|
|
|
|
&ett_ccp_options,
|
|
|
|
&ett_ccp_stac_opt,
|
|
|
|
&ett_ccp_mppc_opt,
|
2002-01-11 21:37:10 +00:00
|
|
|
&ett_ccp_bsdcomp_opt,
|
|
|
|
&ett_ccp_lzsdcp_opt,
|
|
|
|
&ett_ccp_mvrca_opt,
|
|
|
|
&ett_ccp_deflate_opt,
|
2001-10-29 19:48:45 +00:00
|
|
|
};
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_ccp = proto_register_protocol("PPP Compression Control Protocol",
|
2001-10-29 19:48:45 +00:00
|
|
|
"PPP CCP", "ccp");
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_ccp(void)
|
|
|
|
{
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t ccp_handle;
|
|
|
|
|
|
|
|
ccp_handle = create_dissector_handle(dissect_ccp, proto_ccp);
|
|
|
|
dissector_add("ppp.protocol", PPP_CCP, ccp_handle);
|
2001-10-29 19:48:45 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* See above comment about NDISWAN for an explanation of why we're
|
|
|
|
* registering with the "ethertype" dissector table.
|
|
|
|
*/
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_add("ethertype", PPP_CCP, ccp_handle);
|
2001-10-29 19:48:45 +00:00
|
|
|
}
|
|
|
|
|
2001-11-04 04:50:12 +00:00
|
|
|
void
|
|
|
|
proto_register_cbcp(void)
|
|
|
|
{
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_cbcp,
|
|
|
|
&ett_cbcp_options,
|
2002-04-01 00:51:43 +00:00
|
|
|
&ett_cbcp_callback_opt,
|
|
|
|
&ett_cbcp_callback_opt_addr
|
2001-11-04 04:50:12 +00:00
|
|
|
};
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_cbcp = proto_register_protocol("PPP Callback Control Protocol",
|
2001-11-04 04:50:12 +00:00
|
|
|
"PPP CBCP", "cbcp");
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_cbcp(void)
|
|
|
|
{
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t cbcp_handle;
|
|
|
|
|
|
|
|
cbcp_handle = create_dissector_handle(dissect_cbcp, proto_cbcp);
|
|
|
|
dissector_add("ppp.protocol", PPP_CBCP, cbcp_handle);
|
2001-11-04 04:50:12 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* See above comment about NDISWAN for an explanation of why we're
|
|
|
|
* registering with the "ethertype" dissector table.
|
|
|
|
*/
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_add("ethertype", PPP_CBCP, cbcp_handle);
|
2001-11-04 04:50:12 +00:00
|
|
|
}
|
|
|
|
|
2001-12-08 01:03:19 +00:00
|
|
|
void
|
|
|
|
proto_register_bacp(void)
|
|
|
|
{
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_bacp,
|
|
|
|
&ett_bacp_options,
|
|
|
|
&ett_bacp_favored_peer_opt
|
|
|
|
};
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_bacp = proto_register_protocol("PPP Bandwidth Allocation Control Protocol",
|
2001-12-08 01:03:19 +00:00
|
|
|
"PPP BACP", "bacp");
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_bacp(void)
|
|
|
|
{
|
|
|
|
dissector_handle_t bacp_handle;
|
|
|
|
|
|
|
|
bacp_handle = create_dissector_handle(dissect_bacp, proto_bacp);
|
|
|
|
dissector_add("ppp.protocol", PPP_BACP, bacp_handle);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* See above comment about NDISWAN for an explanation of why we're
|
|
|
|
* registering with the "ethertype" dissector table.
|
|
|
|
*/
|
|
|
|
dissector_add("ethertype", PPP_BACP, bacp_handle);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_bap(void)
|
|
|
|
{
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_bap,
|
|
|
|
&ett_bap_options,
|
|
|
|
&ett_bap_link_type_opt,
|
|
|
|
&ett_bap_phone_delta_opt,
|
2002-04-01 00:51:43 +00:00
|
|
|
&ett_bap_phone_delta_subopt,
|
2001-12-08 01:03:19 +00:00
|
|
|
&ett_bap_call_status_opt
|
|
|
|
};
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_bap = proto_register_protocol("PPP Bandwidth Allocation Protocol",
|
2001-12-08 01:03:19 +00:00
|
|
|
"PPP BAP", "bap");
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_bap(void)
|
|
|
|
{
|
|
|
|
dissector_handle_t bap_handle;
|
|
|
|
|
|
|
|
bap_handle = create_dissector_handle(dissect_bap, proto_bap);
|
|
|
|
dissector_add("ppp.protocol", PPP_BAP, bap_handle);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* See above comment about NDISWAN for an explanation of why we're
|
|
|
|
* registering with the "ethertype" dissector table.
|
|
|
|
*/
|
|
|
|
dissector_add("ethertype", PPP_BAP, bap_handle);
|
|
|
|
}
|
|
|
|
|
2001-10-29 19:48:45 +00:00
|
|
|
void
|
|
|
|
proto_register_comp_data(void)
|
|
|
|
{
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_comp_data
|
|
|
|
};
|
|
|
|
|
|
|
|
proto_comp_data = proto_register_protocol("PPP Compressed Datagram",
|
|
|
|
"PPP Comp", "comp_data");
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_comp_data(void)
|
|
|
|
{
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t comp_data_handle;
|
|
|
|
|
|
|
|
comp_data_handle = create_dissector_handle(dissect_comp_data,
|
|
|
|
proto_comp_data);
|
|
|
|
dissector_add("ppp.protocol", PPP_COMP, comp_data_handle);
|
2001-10-29 19:48:45 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* See above comment about NDISWAN for an explanation of why we're
|
|
|
|
* registering with the "ethertype" dissector table.
|
|
|
|
*/
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_add("ethertype", PPP_COMP, comp_data_handle);
|
2001-10-29 19:48:45 +00:00
|
|
|
}
|
|
|
|
|
2001-06-15 20:35:08 +00:00
|
|
|
void
|
|
|
|
proto_register_pap(void)
|
|
|
|
{
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_pap,
|
2002-11-04 03:57:34 +00:00
|
|
|
&ett_pap_data,
|
|
|
|
&ett_pap_peer_id,
|
|
|
|
&ett_pap_password,
|
|
|
|
&ett_pap_message,
|
2001-06-15 20:35:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
proto_pap = proto_register_protocol("PPP Password Authentication Protocol", "PPP PAP",
|
|
|
|
"pap");
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_pap(void)
|
|
|
|
{
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t pap_handle;
|
|
|
|
|
|
|
|
pap_handle = create_dissector_handle(dissect_pap, proto_pap);
|
|
|
|
dissector_add("ppp.protocol", PPP_PAP, pap_handle);
|
2001-06-15 20:35:08 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* See above comment about NDISWAN for an explanation of why we're
|
|
|
|
* registering with the "ethertype" dissector table.
|
|
|
|
*/
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_add("ethertype", PPP_PAP, pap_handle);
|
2001-06-15 20:35:08 +00:00
|
|
|
}
|
2001-09-30 13:30:51 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_chap(void)
|
|
|
|
{
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_chap,
|
|
|
|
&ett_chap_data,
|
|
|
|
&ett_chap_value,
|
|
|
|
&ett_chap_name,
|
|
|
|
&ett_chap_message,
|
|
|
|
};
|
|
|
|
|
|
|
|
proto_chap = proto_register_protocol("PPP Challenge Handshake Authentication Protocol", "PPP CHAP",
|
|
|
|
"chap");
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_chap(void)
|
|
|
|
{
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t chap_handle;
|
|
|
|
|
|
|
|
chap_handle = create_dissector_handle(dissect_chap, proto_chap);
|
|
|
|
dissector_add("ppp.protocol", PPP_CHAP, chap_handle);
|
2001-09-30 13:30:51 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* See above comment about NDISWAN for an explanation of why we're
|
|
|
|
* registering with the "ethertype" dissector table.
|
|
|
|
*/
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_add("ethertype", PPP_CHAP, chap_handle);
|
2001-09-30 13:30:51 +00:00
|
|
|
}
|
2002-01-03 20:30:33 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_pppmuxcp(void)
|
|
|
|
{
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_pppmuxcp,
|
|
|
|
&ett_pppmuxcp_options,
|
|
|
|
};
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_pppmuxcp = proto_register_protocol("PPPMux Control Protocol",
|
2002-01-03 20:30:33 +00:00
|
|
|
"PPP PPPMuxCP",
|
|
|
|
"pppmuxcp");
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_pppmuxcp(void)
|
2002-08-28 21:04:11 +00:00
|
|
|
{
|
|
|
|
dissector_handle_t muxcp_handle;
|
|
|
|
|
2002-01-03 20:30:33 +00:00
|
|
|
muxcp_handle = create_dissector_handle(dissect_pppmuxcp, proto_pppmuxcp);
|
|
|
|
dissector_add("ppp.protocol", PPP_MUXCP, muxcp_handle);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* See above comment about NDISWAN for an explanation of why we're
|
|
|
|
* registering with the "ethertype" dissector table.
|
|
|
|
*/
|
|
|
|
dissector_add("ethertype", PPP_MUXCP, muxcp_handle);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
void
|
|
|
|
proto_register_pppmux(void)
|
|
|
|
{
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_pppmux,
|
|
|
|
&ett_pppmux_subframe,
|
|
|
|
&ett_pppmux_subframe_hdr,
|
|
|
|
&ett_pppmux_subframe_flags,
|
|
|
|
&ett_pppmux_subframe_info,
|
|
|
|
};
|
|
|
|
|
|
|
|
proto_pppmux = proto_register_protocol("PPP Multiplexing",
|
|
|
|
"PPP PPPMux",
|
|
|
|
"pppmux");
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_pppmux(void)
|
|
|
|
{
|
|
|
|
dissector_handle_t pppmux_handle;
|
|
|
|
|
|
|
|
pppmux_handle = create_dissector_handle(dissect_pppmux, proto_pppmux);
|
|
|
|
dissector_add("ppp.protocol", PPP_MUX, pppmux_handle);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* See above comment about NDISWAN for an explanation of why we're
|
|
|
|
* registering with the "ethertype" dissector table.
|
|
|
|
*/
|
|
|
|
dissector_add("ethertype", PPP_MUX, pppmux_handle);
|
|
|
|
}
|
2002-08-18 15:30:38 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_mplscp(void)
|
|
|
|
{
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_mplscp,
|
2002-11-04 03:57:34 +00:00
|
|
|
&ett_mplscp_options,
|
2002-08-18 15:30:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
proto_mplscp = proto_register_protocol("PPP MPLS Control Protocol",
|
|
|
|
"PPP MPLSCP", "mplscp");
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_mplscp(void)
|
|
|
|
{
|
|
|
|
dissector_handle_t mplscp_handle;
|
|
|
|
|
|
|
|
mplscp_handle = create_dissector_handle(dissect_mplscp, proto_mplscp);
|
|
|
|
dissector_add("ppp.protocol", PPP_MPLSCP, mplscp_handle);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* See above comment about NDISWAN for an explanation of why we're
|
|
|
|
* registering with the "ethertype" dissector table.
|
|
|
|
*/
|
|
|
|
dissector_add("ethertype", PPP_MPLSCP, mplscp_handle);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_cdpcp(void)
|
|
|
|
{
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_cdpcp,
|
2002-11-04 03:57:34 +00:00
|
|
|
&ett_cdpcp_options,
|
2002-08-18 15:30:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
proto_cdpcp = proto_register_protocol("PPP CDP Control Protocol",
|
|
|
|
"PPP CDPCP", "cdpcp");
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_cdpcp(void)
|
|
|
|
{
|
|
|
|
dissector_handle_t cdpcp_handle;
|
|
|
|
|
|
|
|
cdpcp_handle = create_dissector_handle(dissect_cdpcp, proto_cdpcp);
|
|
|
|
dissector_add("ppp.protocol", PPP_CDPCP, cdpcp_handle);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* See above comment about NDISWAN for an explanation of why we're
|
|
|
|
* registering with the "ethertype" dissector table.
|
|
|
|
*/
|
|
|
|
dissector_add("ethertype", PPP_CDPCP, cdpcp_handle);
|
|
|
|
}
|
2002-10-14 23:23:20 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_ipv6cp(void)
|
|
|
|
{
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_ipv6cp,
|
|
|
|
&ett_ipv6cp_options,
|
2003-02-07 20:09:33 +00:00
|
|
|
&ett_ipv6cp_if_id_opt,
|
2004-11-22 02:12:43 +00:00
|
|
|
&ett_ipv6cp_compress_opt,
|
2002-10-14 23:23:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
proto_ipv6cp = proto_register_protocol("PPP IPv6 Control Protocol",
|
|
|
|
"PPP IPV6CP", "ipv6cp");
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_ipv6cp(void)
|
|
|
|
{
|
|
|
|
dissector_handle_t ipv6cp_handle;
|
|
|
|
|
|
|
|
ipv6cp_handle = create_dissector_handle(dissect_ipv6cp, proto_ipv6cp);
|
|
|
|
dissector_add("ppp.protocol", PPP_IPV6CP, ipv6cp_handle);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* See above comment about NDISWAN for an explanation of why we're
|
|
|
|
* registering with the "ethertype" dissector table.
|
|
|
|
*/
|
|
|
|
dissector_add("ethertype", PPP_IPV6CP, ipv6cp_handle);
|
|
|
|
}
|