2000-08-25 13:00:05 +00:00
|
|
|
/* packet-pppoe.c
|
|
|
|
* Routines for PPP Over Ethernet (PPPoE) packet disassembly (RFC2516)
|
1999-06-11 15:30:55 +00:00
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
1999-06-11 15:30:55 +00:00
|
|
|
*
|
|
|
|
* Ethereal - Network traffic analyzer
|
2001-12-03 04:00:26 +00:00
|
|
|
* By Gerald Combs <gerald@ethereal.com>
|
1999-06-11 15:30:55 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1999-06-11 15:30:55 +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
|
|
|
*
|
1999-06-11 15:30:55 +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
|
|
|
*
|
1999-06-11 15:30:55 +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
|
|
|
|
|
|
|
|
#include <glib.h>
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/packet.h>
|
|
|
|
#include <epan/strutil.h>
|
2001-04-17 06:43:21 +00:00
|
|
|
#include "etypes.h"
|
1999-06-11 15:30:55 +00:00
|
|
|
|
2001-01-04 04:15:30 +00:00
|
|
|
static int proto_pppoed = -1;
|
|
|
|
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint ett_pppoed = -1;
|
|
|
|
static gint ett_pppoed_tags = -1;
|
|
|
|
|
2001-01-04 04:15:30 +00:00
|
|
|
static int proto_pppoes = -1;
|
|
|
|
|
2001-03-30 06:10:54 +00:00
|
|
|
static dissector_handle_t ppp_handle;
|
2000-11-19 02:00:03 +00:00
|
|
|
|
1999-06-11 15:30:55 +00:00
|
|
|
/* For lack of a better source, I made up the following defines. -jsj */
|
|
|
|
|
|
|
|
#define PPPOE_CODE_SESSION 0x00
|
|
|
|
#define PPPOE_CODE_PADO 0x7
|
|
|
|
#define PPPOE_CODE_PADI 0x9
|
|
|
|
#define PPPOE_CODE_PADR 0x19
|
|
|
|
#define PPPOE_CODE_PADS 0x65
|
|
|
|
#define PPPOE_CODE_PADT 0xa7
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
#define PPPOE_TAG_EOL 0x0000
|
1999-06-11 15:30:55 +00:00
|
|
|
#define PPPOE_TAG_SVC_NAME 0x0101
|
2002-08-28 21:04:11 +00:00
|
|
|
#define PPPOE_TAG_AC_NAME 0x0102
|
1999-06-11 15:30:55 +00:00
|
|
|
#define PPPOE_TAG_HOST_UNIQ 0x0103
|
|
|
|
#define PPPOE_TAG_AC_COOKIE 0x0104
|
2002-08-28 21:04:11 +00:00
|
|
|
#define PPPOE_TAG_VENDOR 0x0105
|
|
|
|
#define PPPOE_TAG_RELAY_ID 0x0110
|
|
|
|
#define PPPOE_TAG_SVC_ERR 0x0201
|
|
|
|
#define PPPOE_TAG_AC_ERR 0x0202
|
1999-06-11 15:30:55 +00:00
|
|
|
#define PPPOE_TAG_GENERIC_ERR 0x0203
|
|
|
|
|
2005-06-26 19:56:52 +00:00
|
|
|
static const gchar *
|
1999-06-11 15:30:55 +00:00
|
|
|
pppoecode_to_str(guint8 codetype, const char *fmt) {
|
|
|
|
static const value_string code_vals[] = {
|
|
|
|
{PPPOE_CODE_SESSION, "Session Data" },
|
|
|
|
{PPPOE_CODE_PADO, "Active Discovery Offer (PADO)" },
|
|
|
|
{PPPOE_CODE_PADI, "Active Discovery Initiation (PADI)" },
|
|
|
|
{PPPOE_CODE_PADR, "Active Discovery Request (PADR)" },
|
|
|
|
{PPPOE_CODE_PADS, "Active Discovery Session-confirmation (PADS)"},
|
|
|
|
{PPPOE_CODE_PADT, "Active Discovery Terminate (PADT)" },
|
|
|
|
{0, NULL } };
|
|
|
|
|
|
|
|
return val_to_str(codetype, code_vals, fmt);
|
|
|
|
}
|
|
|
|
|
2005-06-26 19:56:52 +00:00
|
|
|
static const gchar *
|
1999-06-11 15:30:55 +00:00
|
|
|
pppoetag_to_str(guint16 tag_type, const char *fmt) {
|
|
|
|
static const value_string code_vals[] = {
|
|
|
|
{PPPOE_TAG_EOL, "End-Of-List" },
|
|
|
|
{PPPOE_TAG_SVC_NAME, "Service-Name" },
|
|
|
|
{PPPOE_TAG_AC_NAME, "AC-Name" },
|
|
|
|
{PPPOE_TAG_HOST_UNIQ, "Host-Uniq" },
|
|
|
|
{PPPOE_TAG_AC_COOKIE, "AC-Cookie" },
|
|
|
|
{PPPOE_TAG_VENDOR, "Vendor-Specific" },
|
|
|
|
{PPPOE_TAG_RELAY_ID, "Relay-Session-Id" },
|
|
|
|
{PPPOE_TAG_SVC_ERR, "Service-Name-Error"},
|
|
|
|
{PPPOE_TAG_AC_ERR, "AC-System-Error" },
|
|
|
|
{PPPOE_TAG_GENERIC_ERR,"Generic-Error" },
|
|
|
|
{0, NULL } };
|
|
|
|
|
|
|
|
return val_to_str(tag_type, code_vals, fmt);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-04-16 22:59:37 +00:00
|
|
|
static void
|
2002-05-01 07:54:08 +00:00
|
|
|
dissect_pppoe_tags(tvbuff_t *tvb, int offset, proto_tree *tree, int payload_length) {
|
1999-06-11 15:30:55 +00:00
|
|
|
|
|
|
|
guint16 poe_tag;
|
|
|
|
guint16 poe_tag_length;
|
|
|
|
int tagstart;
|
|
|
|
|
|
|
|
proto_tree *pppoe_tree;
|
|
|
|
proto_item *ti;
|
|
|
|
|
|
|
|
/* Start Decoding Here. */
|
|
|
|
|
|
|
|
if (tree) {
|
2000-11-19 02:00:03 +00:00
|
|
|
ti = proto_tree_add_text(tree, tvb,offset,payload_length,"PPPoE Tags");
|
1999-11-16 11:44:20 +00:00
|
|
|
pppoe_tree = proto_item_add_subtree(ti, ett_pppoed_tags);
|
1999-06-11 15:30:55 +00:00
|
|
|
|
|
|
|
tagstart = offset;
|
|
|
|
while(tagstart <= payload_length-2 ) {
|
|
|
|
|
2000-11-19 02:00:03 +00:00
|
|
|
poe_tag = tvb_get_ntohs(tvb, tagstart);
|
|
|
|
poe_tag_length = tvb_get_ntohs(tvb, tagstart + 2);
|
1999-06-11 15:30:55 +00:00
|
|
|
|
2000-11-19 02:00:03 +00:00
|
|
|
proto_tree_add_text(pppoe_tree, tvb,tagstart,4,
|
1999-06-11 15:30:55 +00:00
|
|
|
"Tag: %s", pppoetag_to_str(poe_tag,"Unknown (0x%02x)"));
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-06-11 15:30:55 +00:00
|
|
|
switch(poe_tag) {
|
|
|
|
case PPPOE_TAG_SVC_NAME:
|
|
|
|
case PPPOE_TAG_AC_NAME:
|
|
|
|
case PPPOE_TAG_SVC_ERR:
|
|
|
|
case PPPOE_TAG_AC_ERR:
|
|
|
|
case PPPOE_TAG_GENERIC_ERR:
|
|
|
|
/* tag value should be interpreted as a utf-8 unterminated string.*/
|
|
|
|
if(poe_tag_length > 0 ) {
|
|
|
|
/* really should do some limit checking here. :( */
|
2000-11-19 02:00:03 +00:00
|
|
|
proto_tree_add_text(pppoe_tree, tvb,tagstart+4,poe_tag_length,
|
|
|
|
" String Data: %s",
|
|
|
|
tvb_format_text(tvb, tagstart+4,poe_tag_length ));
|
1999-06-11 15:30:55 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if(poe_tag_length > 0 ) {
|
2000-11-19 02:00:03 +00:00
|
|
|
proto_tree_add_text(pppoe_tree, tvb,tagstart+4,poe_tag_length,
|
1999-06-11 15:30:55 +00:00
|
|
|
" Binary Data: (%d bytes)", poe_tag_length );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (poe_tag == PPPOE_TAG_EOL) break;
|
|
|
|
|
|
|
|
tagstart += 4 + poe_tag_length;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-04-16 22:59:37 +00:00
|
|
|
static void
|
2000-11-19 02:00:03 +00:00
|
|
|
dissect_pppoed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
|
|
|
|
guint8 pppoe_ver_type;
|
1999-06-11 15:30:55 +00:00
|
|
|
guint8 pppoe_ver;
|
|
|
|
guint8 pppoe_type;
|
|
|
|
guint8 pppoe_code;
|
|
|
|
guint16 pppoe_session_id;
|
|
|
|
guint16 pppoe_length;
|
|
|
|
|
|
|
|
proto_tree *pppoe_tree;
|
|
|
|
proto_item *ti;
|
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
|
|
|
|
col_set_str(pinfo->cinfo,COL_PROTOCOL, "PPPoED");
|
2001-01-04 04:15:30 +00:00
|
|
|
}
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo,COL_INFO)) {
|
|
|
|
col_clear(pinfo->cinfo,COL_INFO);
|
2001-01-04 04:15:30 +00:00
|
|
|
}
|
|
|
|
|
1999-06-11 15:30:55 +00:00
|
|
|
/* Start Decoding Here. */
|
2000-11-19 02:00:03 +00:00
|
|
|
pppoe_ver_type = tvb_get_guint8(tvb, 0);
|
|
|
|
pppoe_ver = (pppoe_ver_type >> 4) & 0x0f;
|
|
|
|
pppoe_type = pppoe_ver_type & 0x0f;
|
|
|
|
pppoe_code = tvb_get_guint8(tvb, 1);
|
1999-06-11 15:30:55 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo,COL_INFO)) {
|
|
|
|
col_add_fstr(pinfo->cinfo,COL_INFO,pppoecode_to_str(pppoe_code,"Unknown code (0x%02x)"));
|
1999-06-11 15:30:55 +00:00
|
|
|
}
|
|
|
|
|
2001-01-04 04:15:30 +00:00
|
|
|
pppoe_session_id = tvb_get_ntohs(tvb, 2);
|
|
|
|
pppoe_length = tvb_get_ntohs(tvb, 4);
|
|
|
|
|
1999-06-11 15:30:55 +00:00
|
|
|
if (tree) {
|
2001-01-04 04:15:30 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_pppoed, tvb,0,
|
|
|
|
pppoe_length+6, FALSE);
|
1999-11-16 11:44:20 +00:00
|
|
|
pppoe_tree = proto_item_add_subtree(ti, ett_pppoed);
|
2000-11-19 02:00:03 +00:00
|
|
|
proto_tree_add_text(pppoe_tree, tvb,0,1,
|
2001-01-04 04:15:30 +00:00
|
|
|
"Version: %u", pppoe_ver);
|
2000-11-19 02:00:03 +00:00
|
|
|
proto_tree_add_text(pppoe_tree, tvb,0,1,
|
2001-01-04 04:15:30 +00:00
|
|
|
"Type: %u", pppoe_type);
|
2000-11-19 02:00:03 +00:00
|
|
|
proto_tree_add_text(pppoe_tree, tvb,1,1,
|
1999-06-11 15:30:55 +00:00
|
|
|
"Code: %s", pppoecode_to_str(pppoe_code,"Unknown (0x%02x)"));
|
2000-11-19 02:00:03 +00:00
|
|
|
proto_tree_add_text(pppoe_tree, tvb,2,2,
|
1999-06-11 15:30:55 +00:00
|
|
|
"Session ID: %04x", pppoe_session_id);
|
2000-11-19 02:00:03 +00:00
|
|
|
proto_tree_add_text(pppoe_tree, tvb,4,2,
|
2001-01-04 04:15:30 +00:00
|
|
|
"Payload Length: %u", pppoe_length);
|
1999-06-11 15:30:55 +00:00
|
|
|
}
|
2002-05-01 07:54:08 +00:00
|
|
|
dissect_pppoe_tags(tvb,6,tree,6+pppoe_length);
|
2001-01-04 04:15:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_pppoed(void)
|
|
|
|
{
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_pppoed,
|
|
|
|
&ett_pppoed_tags,
|
|
|
|
};
|
|
|
|
|
|
|
|
proto_pppoed = proto_register_protocol("PPP-over-Ethernet Discovery",
|
|
|
|
"PPPoED", "pppoed");
|
1999-06-11 15:30:55 +00:00
|
|
|
|
2001-01-04 04:15:30 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_pppoed(void)
|
|
|
|
{
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t pppoed_handle;
|
|
|
|
|
|
|
|
pppoed_handle = create_dissector_handle(dissect_pppoed, proto_pppoed);
|
|
|
|
dissector_add("ethertype", ETHERTYPE_PPPOED, pppoed_handle);
|
1999-06-11 15:30:55 +00:00
|
|
|
}
|
|
|
|
|
2000-04-16 22:59:37 +00:00
|
|
|
static void
|
2000-11-19 02:00:03 +00:00
|
|
|
dissect_pppoes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
|
|
|
|
guint8 pppoe_ver_type;
|
1999-06-11 15:30:55 +00:00
|
|
|
guint8 pppoe_ver;
|
|
|
|
guint8 pppoe_type;
|
|
|
|
guint8 pppoe_code;
|
|
|
|
guint16 pppoe_session_id;
|
|
|
|
guint16 pppoe_length;
|
2002-10-21 18:17:41 +00:00
|
|
|
gint length, reported_length;
|
1999-06-11 15:30:55 +00:00
|
|
|
|
|
|
|
proto_tree *pppoe_tree;
|
|
|
|
proto_item *ti;
|
2000-11-19 02:00:03 +00:00
|
|
|
tvbuff_t *next_tvb;
|
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
|
|
|
|
col_set_str(pinfo->cinfo,COL_PROTOCOL, "PPPoES");
|
2001-01-04 04:15:30 +00:00
|
|
|
}
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo,COL_INFO)) {
|
|
|
|
col_clear(pinfo->cinfo,COL_INFO);
|
2001-01-04 04:15:30 +00:00
|
|
|
}
|
|
|
|
|
1999-06-11 15:30:55 +00:00
|
|
|
/* Start Decoding Here. */
|
2000-11-19 02:00:03 +00:00
|
|
|
pppoe_ver_type = tvb_get_guint8(tvb, 0);
|
|
|
|
pppoe_ver = (pppoe_ver_type >> 4) & 0x0f;
|
|
|
|
pppoe_type = pppoe_ver_type & 0x0f;
|
|
|
|
pppoe_code = tvb_get_guint8(tvb, 1);
|
1999-06-11 15:30:55 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo,COL_INFO)) {
|
|
|
|
col_add_fstr(pinfo->cinfo,COL_INFO,
|
2000-11-19 02:00:03 +00:00
|
|
|
pppoecode_to_str(pppoe_code,"Unknown code (0x%02x)"));
|
1999-06-11 15:30:55 +00:00
|
|
|
}
|
|
|
|
|
2001-01-04 04:15:30 +00:00
|
|
|
pppoe_session_id = tvb_get_ntohs(tvb, 2);
|
|
|
|
pppoe_length = tvb_get_ntohs(tvb, 4);
|
|
|
|
|
1999-06-11 15:30:55 +00:00
|
|
|
if (tree) {
|
2001-01-04 04:15:30 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_pppoes, tvb,0,
|
2002-10-21 18:17:41 +00:00
|
|
|
6, FALSE);
|
1999-11-16 11:44:20 +00:00
|
|
|
pppoe_tree = proto_item_add_subtree(ti, ett_pppoed);
|
2000-11-19 02:00:03 +00:00
|
|
|
proto_tree_add_text(pppoe_tree, tvb,0,1,
|
|
|
|
"Version: %u", pppoe_ver);
|
|
|
|
proto_tree_add_text(pppoe_tree, tvb,0,1,
|
|
|
|
"Type: %u", pppoe_type);
|
|
|
|
proto_tree_add_text(pppoe_tree, tvb,1,1,
|
1999-06-11 15:30:55 +00:00
|
|
|
"Code: %s", pppoecode_to_str(pppoe_code,"Unknown (0x%02x)"));
|
2000-11-19 02:00:03 +00:00
|
|
|
proto_tree_add_text(pppoe_tree, tvb,2,2,
|
1999-06-11 15:30:55 +00:00
|
|
|
"Session ID: %04x", pppoe_session_id);
|
2000-11-19 02:00:03 +00:00
|
|
|
proto_tree_add_text(pppoe_tree, tvb,4,2,
|
|
|
|
"Payload Length: %u", pppoe_length);
|
1999-06-11 15:30:55 +00:00
|
|
|
}
|
|
|
|
/* dissect_ppp is apparently done as a 'top level' dissector,
|
2002-08-28 21:04:11 +00:00
|
|
|
* so this doesn't work:
|
2000-11-19 02:00:03 +00:00
|
|
|
* dissect_ppp(pd,offset+6,pinfo->fd,tree);
|
|
|
|
* Im gonna try fudging it.
|
|
|
|
*/
|
2002-10-21 18:17:41 +00:00
|
|
|
length = tvb_length_remaining(tvb, 6);
|
|
|
|
reported_length = tvb_reported_length_remaining(tvb, 6);
|
2005-06-10 18:28:22 +00:00
|
|
|
DISSECTOR_ASSERT(length >= 0);
|
|
|
|
DISSECTOR_ASSERT(reported_length >= 0);
|
2002-10-21 18:17:41 +00:00
|
|
|
if (length > reported_length)
|
|
|
|
length = reported_length;
|
|
|
|
if ((guint)length > pppoe_length)
|
|
|
|
length = pppoe_length;
|
|
|
|
if ((guint)reported_length > pppoe_length)
|
|
|
|
reported_length = pppoe_length;
|
|
|
|
next_tvb = tvb_new_subset(tvb,6,length,reported_length);
|
2001-03-30 06:10:54 +00:00
|
|
|
call_dissector(ppp_handle,next_tvb,pinfo,tree);
|
1999-06-11 15:30:55 +00:00
|
|
|
}
|
1999-11-16 11:44:20 +00:00
|
|
|
void
|
2001-01-04 04:15:30 +00:00
|
|
|
proto_register_pppoes(void)
|
1999-11-16 11:44:20 +00:00
|
|
|
{
|
2001-01-04 04:15:30 +00:00
|
|
|
proto_pppoes = proto_register_protocol("PPP-over-Ethernet Session",
|
|
|
|
"PPPoES", "pppoes");
|
1999-11-16 11:44:20 +00:00
|
|
|
}
|
|
|
|
|
Change the sub-dissector handoff registration routines so that the
sub-dissector table is not stored in the header_field_info struct, but
in a separate namespace. Dissector tables are now registered by name
and not by field ID. For example:
udp_dissector_table = register_dissector_table("udp.port");
Because of this different namespace, dissector tables can have names
that are not field names. This is useful for ethertype, since multiple
fields are "ethertypes".
packet-ethertype.c replaces ethertype.c (the name was changed so that it
would be named in the same fashion as all the filenames passed to make-reg-dotc)
Although it registers no protocol or field, it registers one dissector table:
ethertype_dissector_table = register_dissector_table("ethertype");
All protocols that can be called because of an ethertype field now register
that fact with dissector_add() calls.
In this way, one dissector_table services all ethertype fields
(hf_eth_type, hf_llc_type, hf_null_etype, hf_vlan_etype)
Furthermore, the code allows for names of protocols to exist in the
etype_vals, yet a dissector for that protocol doesn't exist. The name
of the dissector is printed in COL_INFO. You're welcome, Richard. :-)
svn path=/trunk/; revision=1848
2000-04-13 18:18:56 +00:00
|
|
|
void
|
2001-01-04 04:15:30 +00:00
|
|
|
proto_reg_handoff_pppoes(void)
|
Change the sub-dissector handoff registration routines so that the
sub-dissector table is not stored in the header_field_info struct, but
in a separate namespace. Dissector tables are now registered by name
and not by field ID. For example:
udp_dissector_table = register_dissector_table("udp.port");
Because of this different namespace, dissector tables can have names
that are not field names. This is useful for ethertype, since multiple
fields are "ethertypes".
packet-ethertype.c replaces ethertype.c (the name was changed so that it
would be named in the same fashion as all the filenames passed to make-reg-dotc)
Although it registers no protocol or field, it registers one dissector table:
ethertype_dissector_table = register_dissector_table("ethertype");
All protocols that can be called because of an ethertype field now register
that fact with dissector_add() calls.
In this way, one dissector_table services all ethertype fields
(hf_eth_type, hf_llc_type, hf_null_etype, hf_vlan_etype)
Furthermore, the code allows for names of protocols to exist in the
etype_vals, yet a dissector for that protocol doesn't exist. The name
of the dissector is printed in COL_INFO. You're welcome, Richard. :-)
svn path=/trunk/; revision=1848
2000-04-13 18:18:56 +00:00
|
|
|
{
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t pppoes_handle;
|
|
|
|
|
|
|
|
pppoes_handle = create_dissector_handle(dissect_pppoes, proto_pppoes);
|
|
|
|
dissector_add("ethertype", ETHERTYPE_PPPOES, pppoes_handle);
|
2000-11-19 02:00:03 +00:00
|
|
|
|
|
|
|
/*
|
2001-03-30 06:10:54 +00:00
|
|
|
* Get a handle for the PPP dissector.
|
2000-11-19 02:00:03 +00:00
|
|
|
*/
|
2001-03-30 06:10:54 +00:00
|
|
|
ppp_handle = find_dissector("ppp");
|
Change the sub-dissector handoff registration routines so that the
sub-dissector table is not stored in the header_field_info struct, but
in a separate namespace. Dissector tables are now registered by name
and not by field ID. For example:
udp_dissector_table = register_dissector_table("udp.port");
Because of this different namespace, dissector tables can have names
that are not field names. This is useful for ethertype, since multiple
fields are "ethertypes".
packet-ethertype.c replaces ethertype.c (the name was changed so that it
would be named in the same fashion as all the filenames passed to make-reg-dotc)
Although it registers no protocol or field, it registers one dissector table:
ethertype_dissector_table = register_dissector_table("ethertype");
All protocols that can be called because of an ethertype field now register
that fact with dissector_add() calls.
In this way, one dissector_table services all ethertype fields
(hf_eth_type, hf_llc_type, hf_null_etype, hf_vlan_etype)
Furthermore, the code allows for names of protocols to exist in the
etype_vals, yet a dissector for that protocol doesn't exist. The name
of the dissector is printed in COL_INFO. You're welcome, Richard. :-)
svn path=/trunk/; revision=1848
2000-04-13 18:18:56 +00:00
|
|
|
}
|