aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-dlsw.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-07-14 02:01:49 +0000
committerMichael Mann <mmann78@netscape.net>2013-07-14 02:01:49 +0000
commita32513416b3a1f21b803322e0d88642da0d1fa2b (patch)
treef1a6af6d1499642e25f64f6e517e8e08352746c1 /epan/dissectors/packet-dlsw.c
parentb54d5b7d544a7c8340747c4d1c46221cf043fb9a (diff)
First real test of convert_proto_tree_add_text.pl.
svn path=/trunk/; revision=50566
Diffstat (limited to 'epan/dissectors/packet-dlsw.c')
-rw-r--r--epan/dissectors/packet-dlsw.c245
1 files changed, 165 insertions, 80 deletions
diff --git a/epan/dissectors/packet-dlsw.c b/epan/dissectors/packet-dlsw.c
index 8c83b947f8..46690b9778 100644
--- a/epan/dissectors/packet-dlsw.c
+++ b/epan/dissectors/packet-dlsw.c
@@ -29,6 +29,7 @@
#include <glib.h>
#include <epan/packet.h>
+#include <epan/expert.h>
#include "packet-tcp.h"
void proto_register_dlsw(void);
@@ -39,6 +40,53 @@ static int hf_dlsw_flow_control_indication = -1;
static int hf_dlsw_flow_control_ack = -1;
static int hf_dlsw_flow_control_operator = -1;
static int hf_dlsw_flags_explorer_msg = -1;
+/* Generated from convert_proto_tree_add_text.pl */
+static int hf_dlsw_vector_length = -1;
+static int hf_dlsw_dlc_header_sa = -1;
+static int hf_dlsw_dlc_header_fc_byte = -1;
+static int hf_dlsw_target_transport_id = -1;
+static int hf_dlsw_error_pointer = -1;
+static int hf_dlsw_capabilities_length = -1;
+static int hf_dlsw_multicast_version_number = -1;
+static int hf_dlsw_frame_direction = -1;
+static int hf_dlsw_circuit_priority = -1;
+static int hf_dlsw_origin_dlc_port_id = -1;
+static int hf_dlsw_protocol_id = -1;
+static int hf_dlsw_mac_address_list = -1;
+static int hf_dlsw_origin_link_sap = -1;
+static int hf_dlsw_header_length = -1;
+static int hf_dlsw_dlc_header_ctrl = -1;
+static int hf_dlsw_target_dlc_port_id = -1;
+static int hf_dlsw_vector_type = -1;
+static int hf_dlsw_largest_frame_size = -1;
+static int hf_dlsw_error_cause = -1;
+static int hf_dlsw_dlc_header_length = -1;
+static int hf_dlsw_oui = -1;
+static int hf_dlsw_target_dlc = -1;
+static int hf_dlsw_dlc_header_ac_byte = -1;
+static int hf_dlsw_tcp_connections = -1;
+static int hf_dlsw_initial_pacing_window = -1;
+static int hf_dlsw_old_message_type = -1;
+static int hf_dlsw_ssp_flags = -1;
+static int hf_dlsw_target_mac_address = -1;
+static int hf_dlsw_origin_mac_address = -1;
+static int hf_dlsw_dlc_header_rif = -1;
+static int hf_dlsw_message_type = -1;
+static int hf_dlsw_header_number = -1;
+static int hf_dlsw_message_length = -1;
+static int hf_dlsw_remote_dlc_pid = -1;
+static int hf_dlsw_vendor_oui = -1;
+static int hf_dlsw_flow_ctrl_byte = -1;
+static int hf_dlsw_version_string = -1;
+static int hf_dlsw_version = -1;
+static int hf_dlsw_remote_dlc = -1;
+static int hf_dlsw_origin_dlc = -1;
+static int hf_dlsw_origin_transport_id = -1;
+static int hf_dlsw_dlc_header_ssap = -1;
+static int hf_dlsw_target_link_sap = -1;
+static int hf_dlsw_dlc_header_da = -1;
+static int hf_dlsw_netbios_name = -1;
+static int hf_dlsw_dlc_header_dsap = -1;
static gint ett_dlsw = -1;
static gint ett_dlsw_header = -1;
@@ -47,6 +95,8 @@ static gint ett_dlsw_sspflags = -1;
static gint ett_dlsw_data = -1;
static gint ett_dlsw_vector = -1;
+static expert_field ei_dlsw_dlc_header_length = EI_INIT;
+
#define CANUREACH 0x03
#define ICANREACH 0x04
#define REACH_ACK 0x05
@@ -222,8 +272,9 @@ dissect_dlsw_capex(tvbuff_t *tvb, proto_tree *tree, proto_tree *ti);
static void
dissect_dlsw_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- guint version,hlen = 0,mlen = 0,mtype,dlchlen = 0,direction,flags;
- proto_tree *dlsw_tree = NULL, *ti,*ti2, *dlsw_header_tree = NULL;
+ guint version,hlen = 0,mlen = 0,mtype,dlchlen = 0,flags;
+ proto_tree *dlsw_tree = NULL, *dlsw_header_tree = NULL;
+ proto_item *ti,*ti2;
proto_tree *dlsw_flags_tree,*dlsw_data_tree;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "DLSw");
@@ -241,15 +292,14 @@ dissect_dlsw_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti2 = proto_tree_add_text (dlsw_tree, tvb, 0, hlen,"DLSw header, %s",
val_to_str_const(version , dlsw_version_vals, "Unknown Version"));
-
dlsw_header_tree = proto_item_add_subtree(ti2, ett_dlsw_header);
- proto_tree_add_text (dlsw_header_tree,tvb,0 ,1,"Version = %s",
- val_to_str_const(version , dlsw_version_vals, "Unknown Version, dissection may be inaccurate"));
- proto_tree_add_text (dlsw_header_tree,tvb,1 ,1,"Header Length = %u",hlen) ;
+
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_version, tvb, 0, 1, ENC_NA);
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_header_length, tvb, 1, 1, ENC_NA);
mlen=tvb_get_ntohs(tvb,2);
- proto_tree_add_text (dlsw_header_tree,tvb,2 ,2,"Message Length = %u",mlen);
- proto_tree_add_text (dlsw_header_tree,tvb,4 ,4,"Remote DLC = %u",tvb_get_ntohl(tvb,4)) ;
- proto_tree_add_text (dlsw_header_tree,tvb,8 ,4,"Remote DLC PID = %u",tvb_get_ntohl(tvb,8)) ;
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_message_length, tvb, 2, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_remote_dlc, tvb, 4, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_remote_dlc_pid, tvb, 8, 4, ENC_BIG_ENDIAN);
proto_tree_add_text (dlsw_header_tree,tvb,12,2,"Reserved") ;
} ;
@@ -257,8 +307,7 @@ dissect_dlsw_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",val_to_str_const(mtype , dlsw_type_vals, "Unknown message Type"));
if (tree)
{
- proto_tree_add_text (dlsw_header_tree,tvb,14,1,"Message Type = %s (0x%02x)",
- val_to_str_const(mtype , dlsw_type_vals, "Unknown Type"),mtype);
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_message_type, tvb, 14, 1, ENC_NA);
if (mtype==CAP_EXCHANGE)
{
proto_tree_add_text (dlsw_header_tree,tvb, 15,1,"Not used for CapEx") ;
@@ -266,7 +315,7 @@ dissect_dlsw_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else
{
flags = tvb_get_guint8(tvb,15);
- ti2 = proto_tree_add_text (dlsw_header_tree, tvb, 15,1,"Flow ctrl byte = 0x%02x",flags);
+ ti2 = proto_tree_add_item(dlsw_header_tree, hf_dlsw_flow_ctrl_byte, tvb, 15, 1, ENC_NA);
dlsw_flags_tree = proto_item_add_subtree(ti2, ett_dlsw_fc);
proto_tree_add_item(dlsw_flags_tree, hf_dlsw_flow_control_indication, tvb, 15, 1, ENC_BIG_ENDIAN);
if (flags & 0x80)
@@ -279,56 +328,45 @@ dissect_dlsw_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
if (mtype==CAP_EXCHANGE)
{
- proto_tree_add_text (dlsw_header_tree,tvb, 16,1,"Protocol ID = 0x%02x",tvb_get_guint8(tvb,16)) ;
- proto_tree_add_text (dlsw_header_tree,tvb, 17,1,"Header Number = 0x%02x",tvb_get_guint8(tvb,17)) ;
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_protocol_id, tvb, 16, 1, ENC_NA);
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_header_number, tvb, 17, 1, ENC_NA);
proto_tree_add_text (dlsw_header_tree,tvb, 18,5,"Not used for CapEx") ;
- proto_tree_add_text (dlsw_header_tree,tvb, 23,1,"Old message type = %s (0x%02x)",
- val_to_str_const(tvb_get_guint8(tvb,23) , dlsw_type_vals, "Unknown Type"),
- tvb_get_guint8(tvb,23));
- direction=tvb_get_guint8(tvb,38);
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_old_message_type, tvb, 23, 1, ENC_NA);
proto_tree_add_text (dlsw_header_tree,tvb, 24,14,"Not used for CapEx") ;
- proto_tree_add_text (dlsw_header_tree,tvb, 38,1,"Frame direction = %s (0x%02x)",
- val_to_str_const(direction , dlsw_capex_type_vals, "Unknown Direction"),
- direction);
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_frame_direction, tvb, 38, 1, ENC_NA);
proto_tree_add_text (dlsw_header_tree,tvb, 39,33,"Not used for CapEx") ;
}
else
{
- proto_tree_add_text (dlsw_header_tree,tvb, 16,1,"Protocol ID = 0x%02x",tvb_get_guint8(tvb,16)) ;
- proto_tree_add_text (dlsw_header_tree,tvb, 17,1,"Header Number = 0x%02x",tvb_get_guint8(tvb,17)) ;
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_protocol_id, tvb, 16, 1, ENC_NA);
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_header_number, tvb, 17, 1, ENC_NA);
proto_tree_add_text (dlsw_header_tree,tvb, 18,2,"Reserved") ;
- proto_tree_add_text (dlsw_header_tree,tvb, 20,1,"Largest Frame size = %u",tvb_get_guint8(tvb,20)) ;
- flags = tvb_get_guint8(tvb,21);
- ti2 = proto_tree_add_text (dlsw_header_tree,tvb, 21,1,"SSP Flags = 0x%02x",flags) ;
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_largest_frame_size, tvb, 20, 1, ENC_NA);
+ ti2 = proto_tree_add_item(dlsw_header_tree, hf_dlsw_ssp_flags, tvb, 21, 1, ENC_NA);
dlsw_flags_tree = proto_item_add_subtree(ti2, ett_dlsw_sspflags);
proto_tree_add_item (dlsw_flags_tree, hf_dlsw_flags_explorer_msg, tvb, 21, 1, ENC_BIG_ENDIAN);
- proto_tree_add_text (dlsw_header_tree,tvb, 22,1,"Circuit priority = %s",
- val_to_str((tvb_get_guint8(tvb,22)&7),dlsw_pri_vals, "Unknown (%d)")) ;
- proto_tree_add_text (dlsw_header_tree,tvb, 23,1,"Old message type = %s (0x%02x)",
- val_to_str_const(tvb_get_guint8(tvb,23) , dlsw_type_vals, "Unknown Type"),
- tvb_get_guint8(tvb,23));
- proto_tree_add_text (dlsw_header_tree,tvb, 24,6,"Target MAC Address = %s",tvb_bytes_to_str(tvb,24,6)) ;
- proto_tree_add_text (dlsw_header_tree,tvb, 30,6,"Origin MAC Address = %s",tvb_bytes_to_str(tvb,30,6)) ;
- proto_tree_add_text (dlsw_header_tree,tvb, 36,1,"Origin Link SAP = 0x%02x",tvb_get_guint8(tvb,36)) ;
- proto_tree_add_text (dlsw_header_tree,tvb, 37,1,"Target Link SAP = 0x%02x",tvb_get_guint8(tvb,37)) ;
- direction=tvb_get_guint8(tvb,38);
- proto_tree_add_text (dlsw_header_tree,tvb, 38,1,"Frame direction = %s (0x%02x)",
- val_to_str_const(direction , dlsw_frame_direction_vals, "Unknown Direction"),
- direction);
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_circuit_priority, tvb, 22, 1, ENC_NA);
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_old_message_type, tvb, 23, 1, ENC_NA);
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_target_mac_address, tvb, 24, 6, ENC_NA);
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_origin_mac_address, tvb, 30, 6, ENC_NA);
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_origin_link_sap, tvb, 36, 1, ENC_NA);
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_target_link_sap, tvb, 37, 1, ENC_NA);
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_frame_direction, tvb, 38, 1, ENC_NA);
proto_tree_add_text (dlsw_header_tree,tvb, 39,3,"Reserved") ;
dlchlen=tvb_get_ntohs(tvb,42);
+ ti = proto_tree_add_item(dlsw_header_tree, hf_dlsw_dlc_header_length, tvb, 42, 2, ENC_BIG_ENDIAN);
if ( dlchlen > mlen )
{
- proto_tree_add_text (dlsw_header_tree,tvb, 42,2,"DLC Header Length = %u (bogus, must be <= message length %u)",dlchlen, mlen) ;
+ expert_add_info_format_text(pinfo, ti, &ei_dlsw_dlc_header_length,
+ "DLC Header Length = %u (bogus, must be <= message length %u)",dlchlen, mlen) ;
return;
}
- proto_tree_add_text (dlsw_header_tree,tvb, 42,2,"DLC Header Length = %u",dlchlen) ;
- proto_tree_add_text (dlsw_header_tree,tvb, 44,4,"Origin DLC Port ID = %u",tvb_get_ntohl(tvb,44)) ;
- proto_tree_add_text (dlsw_header_tree,tvb, 48,4,"Origin DLC = %u",tvb_get_ntohl(tvb,48)) ;
- proto_tree_add_text (dlsw_header_tree,tvb, 52,4,"Origin Transport ID = %u",tvb_get_ntohl(tvb,52)) ;
- proto_tree_add_text (dlsw_header_tree,tvb, 56,4,"Target DLC Port ID = %u",tvb_get_ntohl(tvb,56)) ;
- proto_tree_add_text (dlsw_header_tree,tvb, 60,4,"Target DLC = %u",tvb_get_ntohl(tvb,60)) ;
- proto_tree_add_text (dlsw_header_tree,tvb, 64,4,"Target Transport ID = %u",tvb_get_ntohl(tvb,64)) ;
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_origin_dlc_port_id, tvb, 44, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_origin_dlc, tvb, 48, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_origin_transport_id, tvb, 52, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_target_dlc_port_id, tvb, 56, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_target_dlc, tvb, 60, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(dlsw_header_tree, hf_dlsw_target_transport_id, tvb, 64, 4, ENC_BIG_ENDIAN);
proto_tree_add_text (dlsw_header_tree,tvb, 68,4,"Reserved") ;
}
}
@@ -352,14 +390,14 @@ dissect_dlsw_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default:
if (dlchlen!=0)
{
- proto_tree_add_text (dlsw_data_tree,tvb,hlen,1,"DLC Header - AC byte : 0x%02x",tvb_get_guint8(tvb,hlen)) ;
- proto_tree_add_text (dlsw_data_tree,tvb,hlen+1,1,"DLC Header - FC byte : 0x%02x",tvb_get_guint8(tvb,hlen+1)) ;
- proto_tree_add_text (dlsw_data_tree,tvb,hlen+2,6,"DLC Header - DA : %s",tvb_bytes_to_str(tvb,hlen+2,6)) ;
- proto_tree_add_text (dlsw_data_tree,tvb,hlen+8,6,"DLC Header - SA : %s",tvb_bytes_to_str(tvb,hlen+8,6)) ;
- proto_tree_add_text (dlsw_data_tree,tvb,hlen+14,18,"DLC Header - RIF : %s",tvb_bytes_to_str(tvb,hlen+14,18)) ;
- proto_tree_add_text (dlsw_data_tree,tvb,hlen+32,1,"DLC Header - DSAP : 0x%02x",tvb_get_guint8(tvb,hlen+32)) ;
- proto_tree_add_text (dlsw_data_tree,tvb,hlen+33,1,"DLC Header - SSAP : 0x%02x",tvb_get_guint8(tvb,hlen+33)) ;
- proto_tree_add_text (dlsw_data_tree,tvb,hlen+34,1,"DLC Header - Ctrl : 0x%02x",tvb_get_guint8(tvb,hlen+34)) ;
+ proto_tree_add_item(dlsw_data_tree, hf_dlsw_dlc_header_ac_byte, tvb, hlen, 1, ENC_NA);
+ proto_tree_add_item(dlsw_data_tree, hf_dlsw_dlc_header_fc_byte, tvb, hlen+1, 1, ENC_NA);
+ proto_tree_add_item(dlsw_data_tree, hf_dlsw_dlc_header_da, tvb, hlen+2, 6, ENC_NA|ENC_ASCII);
+ proto_tree_add_item(dlsw_data_tree, hf_dlsw_dlc_header_sa, tvb, hlen+8, 6, ENC_NA|ENC_ASCII);
+ proto_tree_add_item(dlsw_data_tree, hf_dlsw_dlc_header_rif, tvb, hlen+14, 18, ENC_NA|ENC_ASCII);
+ proto_tree_add_item(dlsw_data_tree, hf_dlsw_dlc_header_dsap, tvb, hlen+32, 1, ENC_NA);
+ proto_tree_add_item(dlsw_data_tree, hf_dlsw_dlc_header_ssap, tvb, hlen+33, 1, ENC_NA);
+ proto_tree_add_item(dlsw_data_tree, hf_dlsw_dlc_header_ctrl, tvb, hlen+34, 1, ENC_NA);
}
proto_tree_add_text (dlsw_data_tree,tvb,hlen+dlchlen,mlen-dlchlen,"Data") ;
}
@@ -374,16 +412,15 @@ dissect_dlsw_capex(tvbuff_t *tvb, proto_tree *tree, proto_tree *ti2)
proto_tree *ti,*dlsw_vector_tree;
mlen=tvb_get_ntohs(tvb,0);
gdsid=tvb_get_ntohs(tvb,2);
- proto_tree_add_text (tree,tvb,0,2,"Capabilities Length = %d",mlen) ;
+ proto_tree_add_item(tree, hf_dlsw_capabilities_length, tvb, 0, 2, ENC_BIG_ENDIAN);
proto_tree_add_text (tree,tvb,2,2,"%s",val_to_str_const( gdsid, dlsw_gds_vals, "Invalid GDS ID"));
proto_item_append_text(ti2," - %s",val_to_str_const( gdsid, dlsw_gds_vals, "Invalid GDS ID"));
switch (gdsid) {
case DLSW_GDSID_ACK:
break;
case DLSW_GDSID_REF:
- proto_tree_add_text (tree,tvb,4,2,"Error pointer = %d",tvb_get_ntohs(tvb,4));
- proto_tree_add_text (tree,tvb,6,2,"Error cause = %s",
- val_to_str_const(tvb_get_ntohs(tvb,6), dlsw_refuse_vals, "Unknown refuse cause"));
+ proto_tree_add_item(tree, hf_dlsw_error_pointer, tvb, 4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tree, hf_dlsw_error_cause, tvb, 6, 2, ENC_BIG_ENDIAN);
break;
case DLSW_GDSID_SEND:
while (offset < mlen){
@@ -393,25 +430,21 @@ dissect_dlsw_capex(tvbuff_t *tvb, proto_tree *tree, proto_tree *ti2)
ti=proto_tree_add_text (tree,tvb,offset,vlen,"%s",
val_to_str_const(vtype,dlsw_vector_vals,"Unknown vector type"));
dlsw_vector_tree = proto_item_add_subtree(ti, ett_dlsw_vector);
- proto_tree_add_text (dlsw_vector_tree,tvb,offset,1, "Vector Length = %d",vlen);
- proto_tree_add_text (dlsw_vector_tree,tvb,offset+1,1,"Vector Type = %s (0x%02x)",
- val_to_str_const(vtype,dlsw_vector_vals,"Unknown vector type"), vtype);
+ proto_tree_add_item(dlsw_vector_tree, hf_dlsw_vector_length, tvb, offset, 1, ENC_NA);
+ proto_tree_add_item(dlsw_vector_tree, hf_dlsw_vector_type, tvb, offset+1, 1, ENC_NA);
switch (vtype){
case 0x81:
- proto_tree_add_text (dlsw_vector_tree,tvb,offset+2,vlen-2,
- "OUI = 0x%06x",tvb_get_ntoh24(tvb,offset+2));
+ proto_tree_add_item(dlsw_vector_tree, hf_dlsw_oui, tvb, offset+2, vlen-2, ENC_BIG_ENDIAN);
break;
case 0x82:
proto_tree_add_text (dlsw_vector_tree,tvb,offset+2,vlen-2,
"DLSw Version = %d.%d",tvb_get_guint8(tvb,offset+2),tvb_get_guint8(tvb,offset+3));
break;
case 0x83:
- proto_tree_add_text (dlsw_vector_tree,tvb,offset+2,vlen-2,
- "Initial Pacing Window = %d",tvb_get_ntohs(tvb,offset+2));
+ proto_tree_add_item(dlsw_vector_tree, hf_dlsw_initial_pacing_window, tvb, offset+2, vlen-2, ENC_BIG_ENDIAN);
break;
case 0x84:
- proto_tree_add_text (dlsw_vector_tree,tvb,offset+2,vlen-2,
- "Version String = %s",tvb_format_text(tvb,offset+2,vlen-2));
+ proto_tree_add_item(dlsw_vector_tree, hf_dlsw_version_string, tvb, offset+2, vlen-2, ENC_NA|ENC_ASCII);
break;
case 0x85:
proto_tree_add_text (dlsw_vector_tree,tvb,offset+2,vlen-2,
@@ -429,30 +462,24 @@ dissect_dlsw_capex(tvbuff_t *tvb, proto_tree *tree, proto_tree *ti2)
}
break;
case 0x87:
- proto_tree_add_text (dlsw_vector_tree,tvb,offset+2,vlen-2,
- "TCP connections = %d",tvb_get_guint8(tvb,offset+2));
+ proto_tree_add_item(dlsw_vector_tree, hf_dlsw_tcp_connections, tvb, offset+2, vlen-2, ENC_NA);
break;
case 0x88:
proto_tree_add_text (dlsw_vector_tree,tvb,offset+2,vlen-2,
"NetBIOS Name Exclusivity = %s",tvb_get_guint8(tvb,offset+2)==1?"On":"Off");
break;
case 0x89:
- proto_tree_add_text (dlsw_vector_tree,tvb,offset+2,vlen-2,
- "MAC Address List = %s / %s",tvb_bytes_to_str(tvb,offset+2,6)
- ,tvb_bytes_to_str(tvb,offset+8,6));
+ proto_tree_add_item(dlsw_vector_tree, hf_dlsw_mac_address_list, tvb, offset+2, 6, ENC_NA);
+ proto_tree_add_item(dlsw_vector_tree, hf_dlsw_mac_address_list, tvb, offset+8, 6, ENC_NA);
break;
case 0x8a:
- proto_tree_add_text (dlsw_vector_tree,tvb,offset+2,vlen-2,
- /* %s */ "NetBIOS name = %s",/* tvb_get_guint8(tvb,offset+2)==0?"Individual":"Group",*/
- tvb_format_text(tvb,offset+2,vlen-2));
+ proto_tree_add_item(dlsw_vector_tree, hf_dlsw_netbios_name, tvb, offset+2, vlen-2, ENC_NA|ENC_ASCII);
break;
case 0x8b:
- proto_tree_add_text (dlsw_vector_tree,tvb,offset+2,vlen-2,
- "Vendor OUI = 0x%06x",tvb_get_ntoh24(tvb,offset+2));
+ proto_tree_add_item(dlsw_vector_tree, hf_dlsw_vendor_oui, tvb, offset+2, vlen-2, ENC_BIG_ENDIAN);
break;
case 0x8c:
- proto_tree_add_text (dlsw_vector_tree,tvb,offset+2,vlen-2,
- "Multicast Version Number = %d",tvb_get_guint8(tvb,offset+2));
+ proto_tree_add_item(dlsw_vector_tree, hf_dlsw_multicast_version_number, tvb, offset+2, vlen-2, ENC_NA);
break;
default:
proto_tree_add_text (dlsw_vector_tree,tvb,offset+2,vlen-2,"Vector Data = ???");
@@ -529,6 +556,55 @@ proto_register_dlsw(void)
{&hf_dlsw_flags_explorer_msg,
{"Explorer message", "dlsw.flags.explorer_msg", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x80,
NULL, HFILL}},
+ /* Generated from convert_proto_tree_add_text.pl */
+ { &hf_dlsw_version, { "Version", "dlsw.version", FT_UINT8, BASE_DEC, VALS(dlsw_version_vals), 0x0, NULL, HFILL }},
+ { &hf_dlsw_header_length, { "Header Length", "dlsw.header_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_message_length, { "Message Length", "dlsw.message_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_remote_dlc, { "Remote DLC", "dlsw.remote_dlc", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_remote_dlc_pid, { "Remote DLC PID", "dlsw.remote_dlc_pid", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_message_type, { "Message Type", "dlsw.message_type", FT_UINT8, BASE_HEX, VALS(dlsw_type_vals), 0x0, NULL, HFILL }},
+ { &hf_dlsw_flow_ctrl_byte, { "Flow ctrl byte", "dlsw.flow_ctrl_byte", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_protocol_id, { "Protocol ID", "dlsw.protocol_id", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_header_number, { "Header Number", "dlsw.header_number", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_old_message_type, { "Old message type", "dlsw.old_message_type", FT_UINT8, BASE_HEX, VALS(dlsw_type_vals), 0x0, NULL, HFILL }},
+ { &hf_dlsw_frame_direction, { "Frame direction", "dlsw.frame_direction", FT_UINT8, BASE_HEX, VALS(dlsw_capex_type_vals), 0x0, NULL, HFILL }},
+ { &hf_dlsw_largest_frame_size, { "Largest Frame size", "dlsw.largest_frame_size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_ssp_flags, { "SSP Flags", "dlsw.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_circuit_priority, { "Circuit priority", "dlsw.circuit_priority", FT_UINT8, BASE_DEC, VALS(dlsw_pri_vals), 0x7, NULL, HFILL }},
+ { &hf_dlsw_old_message_type, { "Old message type", "dlsw.old_message_type", FT_UINT8, BASE_HEX, VALS(dlsw_type_vals), 0x0, NULL, HFILL }},
+ { &hf_dlsw_target_mac_address, { "Target MAC Address", "dlsw.target_mac_address", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_origin_mac_address, { "Origin MAC Address", "dlsw.origin_mac_address", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_origin_link_sap, { "Origin Link SAP", "dlsw.origin_link_sap", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_target_link_sap, { "Target Link SAP", "dlsw.target_link_sap", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_frame_direction, { "Frame direction", "dlsw.frame_direction", FT_UINT8, BASE_HEX, VALS(dlsw_frame_direction_vals), 0x0, NULL, HFILL }},
+ { &hf_dlsw_dlc_header_length, { "DLC Header Length", "dlsw.dlc_header_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_origin_dlc_port_id, { "Origin DLC Port ID", "dlsw.origin_dlc_port_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_origin_dlc, { "Origin DLC", "dlsw.origin_dlc", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_origin_transport_id, { "Origin Transport ID", "dlsw.origin_transport_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_target_dlc_port_id, { "Target DLC Port ID", "dlsw.target_dlc_port_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_target_dlc, { "Target DLC", "dlsw.target_dlc", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_target_transport_id, { "Target Transport ID", "dlsw.target_transport_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_dlc_header_ac_byte, { "DLC Header - AC byte", "dlsw.dlc_header.ac_byte", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_dlc_header_fc_byte, { "DLC Header - FC byte", "dlsw.dlc_header.fc_byte", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_dlc_header_da, { "DLC Header - DA", "dlsw.dlc_header.da", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_dlc_header_sa, { "DLC Header - SA", "dlsw.dlc_header.sa", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_dlc_header_rif, { "DLC Header - RIF", "dlsw.dlc_header.rif", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_dlc_header_dsap, { "DLC Header - DSAP", "dlsw.dlc_header.dsap", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_dlc_header_ssap, { "DLC Header - SSAP", "dlsw.dlc_header.ssap", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_dlc_header_ctrl, { "DLC Header - Ctrl", "dlsw.dlc_header.ctrl", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_capabilities_length, { "Capabilities Length", "dlsw.capabilities_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_error_pointer, { "Error pointer", "dlsw.error_pointer", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_error_cause, { "Error cause", "dlsw.error_cause", FT_UINT16, BASE_NONE, VALS(dlsw_refuse_vals), 0x0, NULL, HFILL }},
+ { &hf_dlsw_vector_length, { "Vector Length", "dlsw.vector_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_vector_type, { "Vector Type", "dlsw.vector_type", FT_UINT8, BASE_HEX, VALS(dlsw_vector_vals), 0x0, NULL, HFILL }},
+ { &hf_dlsw_oui, { "OUI", "dlsw.oui", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_initial_pacing_window, { "Initial Pacing Window", "dlsw.initial_pacing_window", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_version_string, { "Version String", "dlsw.version_string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_tcp_connections, { "TCP connections", "dlsw.tcp_connections", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_mac_address_list, { "MAC Address List", "dlsw.mac_address_list", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_netbios_name, { "NetBIOS name", "dlsw.netbios_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_vendor_oui, { "Vendor OUI", "dlsw.vendor_oui", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL }},
+ { &hf_dlsw_multicast_version_number, { "Multicast Version Number", "dlsw.multicast_version_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
};
static gint *ett[] = {
@@ -540,9 +616,18 @@ proto_register_dlsw(void)
&ett_dlsw_vector,
};
+ static ei_register_info ei[] = {
+ { &ei_dlsw_dlc_header_length, { "dlsw.dlc_header_length.bogus", PI_PROTOCOL, PI_WARN, "DLC Header Length bogus", EXPFILL }},
+ };
+
+ expert_module_t* expert_dlsw;
+
proto_dlsw = proto_register_protocol("Data Link SWitching", "DLSw", "dlsw");
proto_register_field_array(proto_dlsw, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+ expert_dlsw = expert_register_protocol(proto_dlsw);
+ expert_register_field_array(expert_dlsw, ei, array_length(ei));
+
}
void