2000-04-15 22:11:26 +00:00
|
|
|
/* packet-osi-options.c
|
2002-08-28 21:04:11 +00:00
|
|
|
* Routines for the decode of ISO/OSI option part
|
2000-04-15 22:11:26 +00:00
|
|
|
* Covers:
|
|
|
|
* ISO 8473 CLNP (ConnectionLess Mode Network Service Protocol)
|
2001-08-13 00:56:18 +00:00
|
|
|
* ISO 10589 ISIS (Intradomain Routing Information Exchange Protocol)
|
|
|
|
* ISO 9542 ESIS (End System To Intermediate System Routing Exchange Protocol)
|
2000-04-15 22:11:26 +00:00
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2000-04-15 22:11:26 +00:00
|
|
|
* Ralf Schneider <Ralf.Schneider@t-online.de>
|
|
|
|
*
|
|
|
|
* Ethereal - Network traffic analyzer
|
2002-01-21 07:37:49 +00:00
|
|
|
* By Gerald Combs <gerald@ethereal.com>
|
2000-04-15 22:11:26 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2000-04-15 22:11:26 +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
|
|
|
*
|
2000-04-15 22:11:26 +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
|
|
|
*
|
2000-04-15 22:11:26 +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 <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <glib.h>
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/packet.h>
|
2000-04-15 22:11:26 +00:00
|
|
|
#include "nlpid.h"
|
|
|
|
#include "packet-osi.h"
|
|
|
|
#include "packet-isis.h"
|
|
|
|
#include "packet-isis-clv.h"
|
|
|
|
#include "packet-isis-hello.h"
|
|
|
|
#include "packet-isis-lsp.h"
|
|
|
|
#include "packet-isis-snp.h"
|
|
|
|
#include "packet-esis.h"
|
|
|
|
#include "packet-osi-options.h"
|
|
|
|
|
|
|
|
#define OSI_OPT_SECURITY 0xc5
|
|
|
|
#define OSI_OPT_QOS_MAINTANANCE 0xc3
|
|
|
|
#define OSI_OPT_PRIORITY 0xcd
|
|
|
|
#define OSI_OPT_ADDRESS_MASK 0xe1
|
|
|
|
#define OSI_OPT_SNPA_MASK 0xe2
|
|
|
|
#define OSI_OPT_ES_CONFIG_TIMER 0xc6
|
|
|
|
|
|
|
|
#define OSI_OPT_MAX_PRIORITY 0x0e
|
|
|
|
|
|
|
|
#define OSI_OPT_PADDING 0xcc
|
|
|
|
#define OSI_OPT_SOURCE_ROUTING 0xc8
|
|
|
|
#define OSI_OPT_RECORD_OF_ROUTE 0xcb
|
|
|
|
#define OSI_OPT_REASON_OF_DISCARD 0xc1
|
|
|
|
|
|
|
|
#define OSI_OPT_SEC_MASK 0xc0
|
|
|
|
#define OSI_OPT_SEC_RESERVED 0x00
|
|
|
|
#define OSI_OPT_SEC_SRC_ADR_SPEC 0x40
|
|
|
|
#define OSI_OPT_SEC_DST_ADR_SPEC 0x80
|
|
|
|
#define OSI_OPT_SEC_GLOBAL_UNIQUE 0xc0
|
|
|
|
|
|
|
|
#define OSI_OPT_QOS_MASK 0xc0
|
|
|
|
#define OSI_OPT_QOS_RESERVED 0x00
|
|
|
|
#define OSI_OPT_QOS_SRC_ADR_SPEC 0x40
|
|
|
|
#define OSI_OPT_QOS_DST_ADR_SPEC 0x80
|
|
|
|
#define OSI_OPT_QOS_GLOBAL_UNIQUE 0xc0
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-04-15 22:11:26 +00:00
|
|
|
#define OSI_OPT_QOS_SUB_MASK 0x3f
|
|
|
|
#define OSI_OPT_QOS_SUB_RSVD 0x20
|
|
|
|
#define OSI_OPT_QOS_SUB_SEQ_VS_TRS 0x10
|
|
|
|
#define OSI_OPT_QOS_SUB_CONG_EXPED 0x08
|
|
|
|
#define OSI_OPT_QOS_SUB_TSD_VS_COST 0x04
|
|
|
|
#define OSI_OPT_QOS_SUB_RESERR_TRS 0x02
|
|
|
|
#define OSI_OPT_QOS_SUB_RESERR_COST 0x01
|
|
|
|
|
|
|
|
#define OSI_OPT_RFD_GENERAL 0x00
|
|
|
|
#define OSI_OPT_RFD_ADDRESS 0x80
|
2001-08-13 00:56:18 +00:00
|
|
|
#define OSI_OPT_RFD_SOURCE_ROUTING 0x90
|
2000-04-15 22:11:26 +00:00
|
|
|
#define OSI_OPT_RFD_LIFETIME 0xa0
|
|
|
|
#define OSI_OPT_RFD_PDU_DISCARDED 0xb0
|
|
|
|
#define OSI_OPT_RFD_REASSEMBLY 0xc0
|
|
|
|
|
|
|
|
#define OSI_OPT_RFD_MASK 0xf0
|
|
|
|
#define OSI_OPT_RFD_SUB_MASK 0x0f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static gint ott_osi_options = -1;
|
|
|
|
static gint ott_osi_qos = -1;
|
|
|
|
static gint ott_osi_route = -1;
|
|
|
|
static gint ott_osi_redirect = -1;
|
|
|
|
|
|
|
|
static const value_string osi_opt_sec_vals[] = {
|
|
|
|
{ OSI_OPT_SEC_RESERVED, "Reserved"},
|
|
|
|
{ OSI_OPT_SEC_SRC_ADR_SPEC, "Source Address Specific"},
|
|
|
|
{ OSI_OPT_SEC_DST_ADR_SPEC, "Destination Address Specific"},
|
|
|
|
{ OSI_OPT_SEC_GLOBAL_UNIQUE, "Globally Unique"},
|
|
|
|
{ 0, NULL} };
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-04-15 22:11:26 +00:00
|
|
|
static const value_string osi_opt_qos_vals[] = {
|
|
|
|
{ OSI_OPT_QOS_RESERVED, "Reserved"},
|
|
|
|
{ OSI_OPT_QOS_SRC_ADR_SPEC, "Source Address Specific"},
|
|
|
|
{ OSI_OPT_QOS_DST_ADR_SPEC, "Destination Address Specific"},
|
|
|
|
{ OSI_OPT_QOS_GLOBAL_UNIQUE, "Globally Unique"},
|
|
|
|
{ 0, NULL} };
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-04-15 22:11:26 +00:00
|
|
|
static const value_string osi_opt_qos_sub_vals[] = {
|
|
|
|
{ 0x20, " xx10 0000 Reserved"},
|
|
|
|
{ 0x10, " xx01 0000 Sequencing versus transit delay"},
|
|
|
|
{ 0x08, " xx00 1000 Congestion experienced"},
|
|
|
|
{ 0x04, " xx00 0100 Transit delay versus cost"},
|
|
|
|
{ 0x02, " xx00 0010 Residual error probability versus transit delay"},
|
|
|
|
{ 0x01, " xx00 0001 Residual error probability versus cost"},
|
|
|
|
{ 0, NULL} };
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-04-15 22:11:26 +00:00
|
|
|
static const value_string osi_opt_rfd_general[] = {
|
|
|
|
{ 0x00, "Reason not specified"},
|
|
|
|
{ 0x01, "Protocol procedure error"},
|
|
|
|
{ 0x02, "Incorrect checksum"},
|
|
|
|
{ 0x03, "PDU discarded due to congestion"},
|
|
|
|
{ 0x04, "Header syntax error ( cannot be parsed )"},
|
|
|
|
{ 0x05, "Segmentation needed but not permitted"},
|
|
|
|
{ 0x06, "Incomplete PDU received"},
|
|
|
|
{ 0x07, "Duplicate option"},
|
|
|
|
{ 0, NULL} };
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-04-15 22:11:26 +00:00
|
|
|
static const value_string osi_opt_rfd_address[] = {
|
|
|
|
{ 0x00, "Destination Address unreachable"},
|
|
|
|
{ 0x01, "Destination Address unknown"},
|
|
|
|
{ 0, NULL} };
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-04-15 22:11:26 +00:00
|
|
|
static const value_string osi_opt_rfd_src_route[] = {
|
2001-08-13 00:56:18 +00:00
|
|
|
{ 0x00, "Unspecified source routing error"},
|
|
|
|
{ 0x01, "Syntax error in source routing field"},
|
|
|
|
{ 0x02, "Unknown address in source routing field"},
|
2000-04-15 22:11:26 +00:00
|
|
|
{ 0x03, "Path not acceptable"},
|
|
|
|
{ 0, NULL} };
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-04-15 22:11:26 +00:00
|
|
|
static const value_string osi_opt_rfd_lifetime[] = {
|
|
|
|
{ 0x00, "Lifetime expired while data unit in transit"},
|
|
|
|
{ 0x01, "Lifetime expired during reassembly"},
|
|
|
|
{ 0, NULL} };
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-04-15 22:11:26 +00:00
|
|
|
static const value_string osi_opt_rfd_discarded[] = {
|
|
|
|
{ 0x00, "Unsupported option not specified"},
|
|
|
|
{ 0x01, "Unsupported protocol version"},
|
|
|
|
{ 0x02, "Unsupported security option"},
|
2001-08-13 00:56:18 +00:00
|
|
|
{ 0x03, "Unsupported source routing option"},
|
2000-04-15 22:11:26 +00:00
|
|
|
{ 0x04, "Unsupported recording of route option"},
|
|
|
|
{ 0, NULL} };
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-04-15 22:11:26 +00:00
|
|
|
static const value_string osi_opt_rfd_reassembly[] = {
|
|
|
|
{ 0x00, "Reassembly interference"},
|
|
|
|
{ 0, NULL} };
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-04-15 22:11:26 +00:00
|
|
|
|
2002-04-14 23:04:04 +00:00
|
|
|
static void
|
2002-08-02 23:36:07 +00:00
|
|
|
dissect_option_qos( const guchar type, const guchar sub_type, int offset,
|
|
|
|
guchar len, tvbuff_t *tvb, proto_tree *tree ) {
|
2000-04-15 22:11:26 +00:00
|
|
|
|
2002-08-02 23:36:07 +00:00
|
|
|
guchar tmp_type = 0;
|
2000-04-15 22:11:26 +00:00
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *osi_qos_tree = NULL;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
|
|
|
|
2001-04-23 04:19:40 +00:00
|
|
|
ti = proto_tree_add_text( tree, tvb, offset, len,
|
2000-04-15 22:11:26 +00:00
|
|
|
"Quality of service maintenance: %s",
|
|
|
|
val_to_str( type, osi_opt_qos_vals, "Unknown (0x%x)") );
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-04-15 22:11:26 +00:00
|
|
|
osi_qos_tree = proto_item_add_subtree( ti, ott_osi_qos );
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-04-15 22:11:26 +00:00
|
|
|
if ( OSI_OPT_SEC_MASK == type ) { /* Analye BIT field to get all Values */
|
|
|
|
|
|
|
|
tmp_type = sub_type & OSI_OPT_QOS_SUB_RSVD;
|
|
|
|
if ( tmp_type ) {
|
2001-04-23 04:19:40 +00:00
|
|
|
proto_tree_add_text( osi_qos_tree, tvb, offset, len,
|
2000-04-15 22:11:26 +00:00
|
|
|
val_to_str( tmp_type, osi_opt_qos_sub_vals, "Unknown (0x%x)") );
|
|
|
|
}
|
|
|
|
tmp_type = sub_type & OSI_OPT_QOS_SUB_SEQ_VS_TRS;
|
|
|
|
if ( tmp_type ) {
|
2001-04-23 04:19:40 +00:00
|
|
|
proto_tree_add_text( osi_qos_tree, tvb, offset, len,
|
2000-04-15 22:11:26 +00:00
|
|
|
val_to_str( tmp_type, osi_opt_qos_sub_vals, "Unknown (0x%x)") );
|
|
|
|
}
|
|
|
|
tmp_type = sub_type &OSI_OPT_QOS_SUB_CONG_EXPED;
|
|
|
|
if ( tmp_type ) {
|
2001-04-23 04:19:40 +00:00
|
|
|
proto_tree_add_text( osi_qos_tree, tvb, offset, len,
|
2000-04-15 22:11:26 +00:00
|
|
|
val_to_str( tmp_type, osi_opt_qos_sub_vals, "Unknown (0x%x)") );
|
|
|
|
}
|
|
|
|
tmp_type = sub_type & OSI_OPT_QOS_SUB_TSD_VS_COST;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-04-15 22:11:26 +00:00
|
|
|
if ( tmp_type ) {
|
2001-04-23 04:19:40 +00:00
|
|
|
proto_tree_add_text( osi_qos_tree, tvb, offset, len,
|
2000-04-15 22:11:26 +00:00
|
|
|
val_to_str( tmp_type, osi_opt_qos_sub_vals, "Unknown (0x%x)") );
|
|
|
|
}
|
|
|
|
tmp_type = sub_type & OSI_OPT_QOS_SUB_RESERR_TRS;
|
|
|
|
if ( tmp_type ) {
|
2001-04-23 04:19:40 +00:00
|
|
|
proto_tree_add_text( osi_qos_tree, tvb, offset, len,
|
2000-04-15 22:11:26 +00:00
|
|
|
val_to_str( tmp_type, osi_opt_qos_sub_vals, "Unknown (0x%x)") );
|
|
|
|
}
|
|
|
|
tmp_type = sub_type & OSI_OPT_QOS_SUB_RESERR_COST;
|
|
|
|
if ( tmp_type ) {
|
2001-04-23 04:19:40 +00:00
|
|
|
proto_tree_add_text( osi_qos_tree, tvb, offset, len,
|
2000-04-15 22:11:26 +00:00
|
|
|
val_to_str( tmp_type, osi_opt_qos_sub_vals, "Unknown (0x%x)") );
|
|
|
|
}
|
|
|
|
}
|
2001-03-09 04:35:25 +00:00
|
|
|
}
|
|
|
|
|
2002-04-14 23:04:04 +00:00
|
|
|
static void
|
2003-12-13 02:30:18 +00:00
|
|
|
dissect_option_route( guchar parm_type, int offset, guchar parm_len,
|
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, proto_tree *tree ) {
|
2000-04-15 22:11:26 +00:00
|
|
|
|
2002-08-02 23:36:07 +00:00
|
|
|
guchar next_hop = 0;
|
2005-05-07 00:14:11 +00:00
|
|
|
guint16 this_hop = 0;
|
2002-08-02 23:36:07 +00:00
|
|
|
guchar netl = 0;
|
|
|
|
guchar last_hop = 0;
|
|
|
|
guchar cnt_hops = 0;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-04-15 22:11:26 +00:00
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *osi_route_tree = NULL;
|
|
|
|
|
|
|
|
static const value_string osi_opt_route[] = {
|
|
|
|
{ 0x03, "No Network Entity Titles Recorded Yet"},
|
|
|
|
{ 0xff, "Recording Terminated !"},
|
|
|
|
{ 0, NULL} };
|
|
|
|
|
|
|
|
if ( parm_type == OSI_OPT_SOURCE_ROUTING ) {
|
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
|
|
|
next_hop = tvb_get_guint8(tvb, offset + 1 );
|
|
|
|
netl = tvb_get_guint8(tvb, next_hop + 2 );
|
2000-04-15 22:11:26 +00:00
|
|
|
this_hop = offset + 3; /* points to first netl */
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
ti = proto_tree_add_text( tree, tvb, offset + next_hop, netl,
|
2000-04-15 22:11:26 +00:00
|
|
|
"Source Routing: %s ( Next Hop Highlighted In Data Buffer )",
|
2001-08-13 00:56:18 +00:00
|
|
|
(tvb_get_guint8(tvb, offset) == 0) ? "Partial Source Routing" :
|
2002-08-28 21:04:11 +00:00
|
|
|
"Complete Source Routing" );
|
2000-04-15 22:11:26 +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
|
|
|
last_hop = tvb_get_guint8(tvb, offset + 1 );
|
|
|
|
/* points to the end of the list */
|
|
|
|
netl = tvb_get_guint8(tvb, last_hop );
|
|
|
|
/* mis-used to highlight buffer */
|
2000-04-15 22:11:26 +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
|
|
|
ti = proto_tree_add_text( tree, tvb, offset + next_hop, netl,
|
2000-04-15 22:11:26 +00:00
|
|
|
"Record of Route: %s : %s",
|
2001-08-13 00:56:18 +00:00
|
|
|
(tvb_get_guint8(tvb, offset) == 0) ? "Partial Source Routing" :
|
|
|
|
"Complete Source Routing" ,
|
2000-04-15 22:11:26 +00:00
|
|
|
val_to_str( last_hop, osi_opt_route, "Unknown (0x%x" ) );
|
2002-08-28 21:04:11 +00:00
|
|
|
if ( 255 == last_hop )
|
2000-04-15 22:11:26 +00:00
|
|
|
this_hop = parm_len + 1; /* recording terminated, nothing to show */
|
|
|
|
else
|
|
|
|
this_hop = offset + 3;
|
|
|
|
}
|
|
|
|
osi_route_tree = proto_item_add_subtree( ti, ott_osi_route );
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-04-15 22:11:26 +00:00
|
|
|
while ( this_hop < parm_len ) {
|
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
|
|
|
netl = tvb_get_guint8(tvb, this_hop + 1);
|
|
|
|
proto_tree_add_text( osi_route_tree, tvb, offset + this_hop, netl,
|
2000-04-15 22:11:26 +00:00
|
|
|
"Hop #%3u NETL: %2u, NET: %s",
|
|
|
|
cnt_hops++,
|
|
|
|
netl,
|
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
|
|
|
print_nsap_net( tvb_get_ptr(tvb, this_hop + 1, netl), netl ) );
|
2000-04-15 22:11:26 +00:00
|
|
|
this_hop += 1 + netl;
|
|
|
|
}
|
2001-03-09 04:35:25 +00:00
|
|
|
}
|
2000-04-15 22:11:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2002-04-14 23:04:04 +00:00
|
|
|
static void
|
2003-12-13 02:30:18 +00:00
|
|
|
dissect_option_rfd( const guchar error, const guchar field, int offset,
|
2002-08-02 23:36:07 +00:00
|
|
|
guchar len, tvbuff_t *tvb, proto_tree *tree ) {
|
|
|
|
guchar error_class = 0;
|
2005-08-05 00:23:22 +00:00
|
|
|
const char *format_string[] =
|
2000-04-15 22:11:26 +00:00
|
|
|
{ "Reason for discard {General} : %s, in field %u",
|
|
|
|
"Reason for discard {Address} : %s, in field %u",
|
2001-08-13 00:56:18 +00:00
|
|
|
"Reason for discard {Source Routing}: %s, in field %u",
|
2000-04-15 22:11:26 +00:00
|
|
|
"Reason for discard {Lifetime} : %s, in field %u",
|
|
|
|
"Reason for discard {PDU discarded} : %s, in field %u",
|
|
|
|
"Reason for discard {Reassembly} : %s, in field %u"
|
|
|
|
};
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-04-15 22:11:26 +00:00
|
|
|
error_class = error & OSI_OPT_RFD_MASK;
|
2005-04-25 16:23:00 +00:00
|
|
|
tvb_ensure_bytes_exist(tvb, offset + field, 1);
|
2000-04-15 22:11:26 +00:00
|
|
|
|
|
|
|
if ( OSI_OPT_RFD_GENERAL == error_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
|
|
|
proto_tree_add_text( tree, tvb, offset + field, 1, format_string[0],
|
2000-04-15 22:11:26 +00:00
|
|
|
val_to_str( error & OSI_OPT_RFD_SUB_MASK,
|
|
|
|
osi_opt_rfd_general, "Unknown (0x%x)"), field );
|
|
|
|
}
|
|
|
|
else if ( OSI_OPT_RFD_ADDRESS == error_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
|
|
|
proto_tree_add_text( tree, tvb, offset + field, 1, format_string[1],
|
2000-04-15 22:11:26 +00:00
|
|
|
val_to_str( error & OSI_OPT_RFD_SUB_MASK,
|
|
|
|
osi_opt_rfd_address, "Unknown (0x%x)"), field );
|
|
|
|
}
|
2001-08-13 00:56:18 +00:00
|
|
|
else if ( OSI_OPT_RFD_SOURCE_ROUTING == error_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
|
|
|
proto_tree_add_text( tree, tvb, offset + field, 1, format_string[2],
|
2000-04-15 22:11:26 +00:00
|
|
|
val_to_str( error & OSI_OPT_RFD_SUB_MASK,
|
|
|
|
osi_opt_rfd_src_route, "Unknown (0x%x)"), field );
|
|
|
|
}
|
|
|
|
else if ( OSI_OPT_RFD_LIFETIME == error_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
|
|
|
proto_tree_add_text( tree, tvb, offset + field, 1, format_string[3],
|
2000-04-15 22:11:26 +00:00
|
|
|
val_to_str( error & OSI_OPT_RFD_SUB_MASK,
|
|
|
|
osi_opt_rfd_lifetime, "Unknown (0x%x)"), field );
|
|
|
|
}
|
|
|
|
else if ( OSI_OPT_RFD_PDU_DISCARDED == error_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
|
|
|
proto_tree_add_text( tree, tvb, offset + field, 1, format_string[4],
|
2000-04-15 22:11:26 +00:00
|
|
|
val_to_str( error & OSI_OPT_RFD_SUB_MASK,
|
|
|
|
osi_opt_rfd_discarded, "Unknown (0x%x)"), field );
|
|
|
|
}
|
|
|
|
else if ( OSI_OPT_RFD_REASSEMBLY == error_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
|
|
|
proto_tree_add_text( tree, tvb, offset + field, 1, format_string[5],
|
2000-04-15 22:11:26 +00:00
|
|
|
val_to_str( error & OSI_OPT_RFD_SUB_MASK,
|
|
|
|
osi_opt_rfd_reassembly, "Unknown (0x%x)"), field );
|
|
|
|
}
|
|
|
|
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( tree, tvb, offset, len,
|
2000-04-15 22:11:26 +00:00
|
|
|
"Reason for discard: UNKNOWN Error Class" );
|
2002-08-28 21:04:11 +00:00
|
|
|
}
|
2001-03-09 04:35:25 +00:00
|
|
|
}
|
2000-04-15 22:11:26 +00:00
|
|
|
|
|
|
|
/* ############################## Dissection Functions ###################### */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Name: dissect_osi_options()
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2000-04-15 22:11:26 +00:00
|
|
|
* Description:
|
|
|
|
* Main entry area for esis de-mangling. This will build the
|
|
|
|
* main esis tree data and call the sub-protocols as needed.
|
|
|
|
*
|
|
|
|
* Input:
|
2002-08-28 21:04:11 +00:00
|
|
|
* guchar : length of option section
|
2002-04-07 21:54:48 +00:00
|
|
|
* tvbuff_t * : tvbuff containing packet data
|
2000-04-15 22:11:26 +00:00
|
|
|
* int : offset into packet where we are (packet_data[offset]== start
|
|
|
|
* of what we care about)
|
|
|
|
* proto_tree * : tree of display data. May be NULL.
|
|
|
|
*
|
|
|
|
* Output:
|
|
|
|
* void, but we will add to the proto_tree if it is not NULL.
|
|
|
|
*/
|
|
|
|
void
|
2002-08-28 21:04:11 +00:00
|
|
|
dissect_osi_options( guchar opt_len, tvbuff_t *tvb,
|
2002-04-07 21:54:48 +00:00
|
|
|
int offset, proto_tree *tree) {
|
2000-04-15 22:11:26 +00:00
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *osi_option_tree = NULL;
|
2002-08-02 23:36:07 +00:00
|
|
|
guchar parm_len = 0;
|
|
|
|
guchar parm_type = 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
|
|
|
guint8 octet;
|
2000-04-15 22:11:26 +00:00
|
|
|
|
|
|
|
if (tree) {
|
|
|
|
if ( 0 == opt_len ) {
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_text( tree, tvb, offset, 0,
|
2000-04-15 22:11:26 +00:00
|
|
|
"### No Options for this PDU ###" );
|
|
|
|
return;
|
|
|
|
}
|
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
|
|
|
ti = proto_tree_add_text( tree, tvb, offset, opt_len,
|
2000-04-15 22:11:26 +00:00
|
|
|
"### Option Section ###" );
|
|
|
|
osi_option_tree = proto_item_add_subtree( ti, ott_osi_options );
|
|
|
|
|
|
|
|
while ( 0 < opt_len ) {
|
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
|
|
|
parm_type = (int) tvb_get_guint8(tvb, offset);
|
|
|
|
offset++;
|
|
|
|
parm_len = (int) tvb_get_guint8(tvb, offset);
|
|
|
|
offset++;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-04-15 22:11:26 +00:00
|
|
|
switch ( parm_type ) {
|
|
|
|
case OSI_OPT_QOS_MAINTANANCE:
|
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
|
|
|
octet = tvb_get_guint8(tvb, offset);
|
2003-12-11 21:23:37 +00:00
|
|
|
dissect_option_qos( (guchar) (octet&OSI_OPT_QOS_MASK),
|
|
|
|
(guchar) (octet&OSI_OPT_QOS_SUB_MASK),
|
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
|
|
|
offset, parm_len, tvb, osi_option_tree );
|
2000-04-15 22:11:26 +00:00
|
|
|
break;
|
|
|
|
case OSI_OPT_SECURITY:
|
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
|
|
|
octet = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_text( osi_option_tree, tvb, offset, parm_len,
|
2000-04-15 22:11:26 +00:00
|
|
|
"Security type: %s",
|
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
|
|
|
val_to_str( octet&OSI_OPT_SEC_MASK,
|
2000-04-15 22:11:26 +00:00
|
|
|
osi_opt_sec_vals, "Unknown (0x%x)") );
|
|
|
|
break;
|
|
|
|
case OSI_OPT_PRIORITY:
|
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
|
|
|
octet = tvb_get_guint8(tvb, offset);
|
2002-08-28 21:04:11 +00:00
|
|
|
if ( OSI_OPT_MAX_PRIORITY >= octet ) {
|
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( osi_option_tree, tvb, offset, parm_len,
|
|
|
|
"Priority : %u", octet );
|
2000-04-15 22:11:26 +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( osi_option_tree, tvb, offset, parm_len,
|
2002-08-28 21:04:11 +00:00
|
|
|
"Priority : %u ( Invalid )",
|
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
|
|
|
octet );
|
2002-08-28 21:04:11 +00:00
|
|
|
}
|
2000-04-15 22:11:26 +00:00
|
|
|
break;
|
|
|
|
case OSI_OPT_ADDRESS_MASK:
|
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( osi_option_tree, tvb, offset, parm_len,
|
|
|
|
"Address Mask: %s",
|
|
|
|
print_area( tvb_get_ptr(tvb, offset, parm_len), parm_len ) );
|
2000-04-15 22:11:26 +00:00
|
|
|
break;
|
|
|
|
case OSI_OPT_SNPA_MASK:
|
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( osi_option_tree, tvb, offset, parm_len,
|
|
|
|
"SNPA Mask : %s",
|
|
|
|
print_system_id( tvb_get_ptr(tvb, offset, parm_len), parm_len ));
|
2000-04-15 22:11:26 +00:00
|
|
|
break;
|
|
|
|
case OSI_OPT_ES_CONFIG_TIMER:
|
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( osi_option_tree, tvb, offset, parm_len,
|
2002-08-28 21:04:11 +00:00
|
|
|
"ESCT : %u seconds", tvb_get_ntohs( tvb, offset ) );
|
2000-04-15 22:11:26 +00:00
|
|
|
break;
|
|
|
|
case OSI_OPT_PADDING:
|
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( osi_option_tree, tvb, offset, parm_len,
|
2000-04-15 22:11:26 +00:00
|
|
|
"Padding : %u Octets", parm_len ) ;
|
|
|
|
break;
|
|
|
|
case OSI_OPT_SOURCE_ROUTING:
|
|
|
|
case OSI_OPT_RECORD_OF_ROUTE:
|
|
|
|
dissect_option_route( parm_type,
|
2003-12-13 02:30:18 +00:00
|
|
|
offset, parm_len, tvb, osi_option_tree );
|
2000-04-15 22:11:26 +00:00
|
|
|
break;
|
|
|
|
case OSI_OPT_REASON_OF_DISCARD:
|
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_option_rfd( tvb_get_guint8(tvb, offset),
|
|
|
|
tvb_get_guint8(tvb, offset + 1),
|
2003-12-13 02:30:18 +00:00
|
|
|
offset, parm_len, tvb, osi_option_tree );
|
2000-04-15 22:11:26 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
opt_len -= parm_len + 2;
|
|
|
|
offset += parm_len;
|
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
}
|
2001-03-09 04:35:25 +00:00
|
|
|
} /* dissect-osi-options */
|
2000-04-15 22:11:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Name: proto_register_osi_options()
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* main register for esis protocol set. We register some display
|
|
|
|
* formats and the protocol module variables.
|
|
|
|
*
|
|
|
|
* NOTE: this procedure to autolinked by the makefile process that
|
|
|
|
* builds register.c
|
|
|
|
*
|
|
|
|
* Input:
|
|
|
|
* void
|
|
|
|
*
|
|
|
|
* Output:
|
|
|
|
* void
|
|
|
|
*/
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_osi_options(void) {
|
|
|
|
static gint *ott[] = {
|
|
|
|
&ott_osi_options,
|
|
|
|
&ott_osi_qos,
|
|
|
|
&ott_osi_route,
|
|
|
|
&ott_osi_redirect,
|
|
|
|
};
|
|
|
|
proto_register_subtree_array( ott, array_length(ott));
|
2001-03-09 04:35:25 +00:00
|
|
|
}
|