Various minor cleanup, including:

- remove unneeded #includes;
- remove some unneeded initializers;
- use tvb_reported_length() instead of tvb_length();
- use  val_to_str_const() instead of val_to_str();
- fix some typos;
- do some whitespace changes and some reformatting.

svn path=/trunk/; revision=43707
This commit is contained in:
Bill Meier 2012-07-13 22:06:40 +00:00
parent b1eb22bd51
commit 7320ebcfd9
4 changed files with 146 additions and 158 deletions

View File

@ -30,8 +30,6 @@
#endif
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/tvbuff.h>
#include <epan/strutil.h>
#include <epan/expert.h>
#include <epan/dissectors/packet-tcp.h>
@ -514,7 +512,7 @@ dissect_dbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
default: /* same as BIG_ENDIAN */
/* XXX we should probably return 0; */
dinfo.enc = ENC_NA;
dinfo.enc = ENC_NA;
dinfo.get16 = tvb_get_ntohs;
dinfo.get32 = tvb_get_ntohl;
dinfo.getdouble = tvb_get_ntohieee_double;
@ -541,7 +539,7 @@ dissect_dbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
#define DBUS_HEADER_LEN 16
static guint
static guint
get_dbus_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
{
guint32 (*get_guint32)(tvbuff_t *, const gint);
@ -578,7 +576,7 @@ dissect_dbus_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
return tvb_length(tvb);
}
void
void
proto_register_dbus(void)
{
/* XXX, FT_NONE -> FT_BYTES? */
@ -642,7 +640,7 @@ proto_register_dbus(void)
}
};
static gint *ett[] = {
static gint *ett[] = {
&ett_dbus,
&ett_dbus_hdr,
&ett_dbus_body,
@ -655,7 +653,7 @@ proto_register_dbus(void)
proto_register_subtree_array(ett, array_length(ett));
}
void
void
proto_reg_handoff_dbus(void)
{
dissector_handle_t dbus_handle = new_create_dissector_handle(dissect_dbus, proto_dbus);

View File

@ -28,25 +28,13 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <glib.h>
#include <epan/packet.h>
#include "packet-windows-common.h"
#include "packet-smb-common.h"
#include "packet-frame.h"
#include <epan/asn1.h>
#include "packet-kerberos.h"
#include <epan/prefs.h>
#include <epan/emem.h>
#include <epan/tap.h>
#include <epan/expert.h>
#include "packet-dcerpc.h"
#include "packet-gssapi.h"
#include <wsutil/crc32.h>
static int proto_negoex = -1;
static int hf_negoex_sig = -1;
@ -189,7 +177,7 @@ dissect_negoex_verify_message(tvbuff_t *tvb,
checksum_vector_offset = tvb_get_letohl(tvb, offset);
checksum_vector_count = tvb_get_letohs(tvb, offset + 4);
pi_chk = proto_tree_add_text(checksum, tvb, offset, 8,
pi_chk = proto_tree_add_text(checksum, tvb, offset, 8,
"Checksum Vector: %u at %u",
checksum_vector_count,
checksum_vector_offset);
@ -207,7 +195,7 @@ dissect_negoex_verify_message(tvbuff_t *tvb,
offset, 2, ENC_NA);
offset += 2;
proto_tree_add_item(checksum_vector, hf_negoex_checksum, tvb,
proto_tree_add_item(checksum_vector, hf_negoex_checksum, tvb,
checksum_vector_offset, checksum_vector_count, ENC_NA);
}
@ -238,7 +226,7 @@ dissect_negoex_exchange_message(tvbuff_t *tvb,
exchange_vector_count, exchange_vector_offset);
exchange_vector = proto_item_add_subtree(pi, ett_negoex_exchange);
proto_tree_add_item(exchange_vector, hf_negoex_exchange_vector_offset, tvb,
proto_tree_add_item(exchange_vector, hf_negoex_exchange_vector_offset, tvb,
offset, 4, ENC_LITTLE_ENDIAN);
offset += 4;
@ -255,15 +243,15 @@ dissect_negoex_exchange_message(tvbuff_t *tvb,
}
/*
* In each of the subdissectors we are handed the whole message, but the
* header is already dissected. The offset tells us where in buffer the
* In each of the subdissectors we are handed the whole message, but the
* header is already dissected. The offset tells us where in the buffer the
* actual data starts. This is a bit redundant, but it allows for changes
* to the header structure ...
*
* Eventually we want to treat the header and body differently perhaps.
*/
static void
dissect_negoex_nego_message(tvbuff_t *tvb,
dissect_negoex_nego_message(tvbuff_t *tvb,
packet_info *pinfo _U_,
proto_tree *tree,
guint32 start_off)
@ -338,14 +326,14 @@ dissect_negoex_nego_message(tvbuff_t *tvb,
proto_item *bv_pi;
proto_tree *bv_tree;
/*
* Dissect these things ... they consist of a byte vector, so we
/*
* Dissect these things ... they consist of a byte vector, so we
* add a subtree and point to the relevant bytes
*/
byte_vector_offset = tvb_get_letohl(tvb, offset);
byte_vector_count = tvb_get_letohs(tvb, offset + 4);
bv_pi = proto_tree_add_text(extension_vector, tvb,
bv_pi = proto_tree_add_text(extension_vector, tvb,
extension_vector_offset + i * 8, 8,
"Extension: %u bytes at %u",
byte_vector_count, byte_vector_offset);
@ -376,7 +364,7 @@ dissect_negoex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
negoex_tree = NULL;
tf = NULL;
done = FALSE;
payload_len = tvb_length(tvb);
payload_len = tvb_length(tvb);
message_len = 0;
message_type = 0; /* This is a MESSAGE_TYPE_INITIATOR_NEGO ... */
header_len = 0;
@ -388,8 +376,8 @@ dissect_negoex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/*
* There can me multiple negoex messages, each with a header with a length.
* However, the payload might not have been reassembled ...
* There can be multiple negoex messages, each with a header with a length.
* However, the payload might not have been reassembled ...
*/
while (offset < payload_len && !done) {
@ -406,12 +394,12 @@ dissect_negoex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Message type, it is after the signature */
message_type = tvb_get_letohl(tvb, offset + 8);
/* Add the message type tree ... set its lenght below */
/* Add the message type tree ... set its length below */
msg = proto_tree_add_text(negoex_tree, tvb, offset, -1,
"NEGEOX %s",
val_to_str(message_type,
negoex_message_types,
"Unknown NEGOEX message type"));
val_to_str_const(message_type,
negoex_message_types,
"Unknown NEGOEX message type"));
/* Add a subtree for the message */
negoex_msg_tree = proto_item_add_subtree(msg, ett_negoex_msg);
@ -426,13 +414,13 @@ dissect_negoex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 8;
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ", "%s",
val_to_str(message_type,
negoex_message_types,
"Unknown NEGOEX message type"));
val_to_str_const(message_type,
negoex_message_types,
"Unknown NEGOEX message type"));
proto_tree_add_uint(negoex_hdr_tree, hf_negoex_message_type,
tvb, offset, 4, message_type);
/*
/*
* If this is an unknown message type, we have to punt because anything
* following cannot be handled
*/
@ -469,10 +457,10 @@ dissect_negoex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 16;
/*
* Construct a new TVB covering just this message and pass to the
* Construct a new TVB covering just this message and pass to the
* sub-dissector
*/
msg_tvb = tvb_new_subset(tvb,
msg_tvb = tvb_new_subset(tvb,
start_offset,
MIN(message_len, tvb_length(tvb)),
message_len);
@ -480,9 +468,9 @@ dissect_negoex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
switch (message_type) {
case MESSAGE_TYPE_INITIATOR_NEGO:
case MESSAGE_TYPE_ACCEPTOR_NEGO:
dissect_negoex_nego_message(msg_tvb,
pinfo,
negoex_msg_tree,
dissect_negoex_nego_message(msg_tvb,
pinfo,
negoex_msg_tree,
offset - start_offset);
break;
@ -490,7 +478,7 @@ dissect_negoex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case MESSAGE_TYPE_ACCEPTOR_META_DATA:
case MESSAGE_TYPE_CHALLENGE:
case MESSAGE_TYPE_AP_REQUEST:
dissect_negoex_exchange_message(msg_tvb,
dissect_negoex_exchange_message(msg_tvb,
pinfo,
negoex_msg_tree,
offset - start_offset);
@ -545,9 +533,9 @@ proto_register_negoex(void)
{ "Signature", "negoex.message.sig", FT_STRING, BASE_NONE,
NULL, 0x0, NULL, HFILL }},
{ &hf_negoex_message_type,
{ "MessageType", "negoex.message.type", FT_UINT32, BASE_HEX,
{ "MessageType", "negoex.message.type", FT_UINT32, BASE_HEX,
VALS(negoex_message_types), 0x00, NULL, HFILL }},
{ &hf_negoex_sequence_num,
{ &hf_negoex_sequence_num,
{ "SequencNum", "negoex.message.seq_num", FT_UINT32, BASE_DEC,
NULL, 0x0, NULL, HFILL }},
{ &hf_negoex_header_len,
@ -560,7 +548,7 @@ proto_register_negoex(void)
{ "ConversationID", "negoex.message.conv_id", FT_GUID, BASE_NONE,
NULL, 0x0, NULL, HFILL}},
{ &hf_negoex_random,
{ "Random", "negoex.message.random", FT_BYTES, BASE_NONE,
{ "Random", "negoex.message.random", FT_BYTES, BASE_NONE,
NULL, 0x0, "Random data", HFILL }},
{ &hf_negoex_proto_version,
{ "ProtocolVersion", "negoex.proto_version", FT_UINT64, BASE_DEC,
@ -593,7 +581,7 @@ proto_register_negoex(void)
{ "ExchangeOffset", "negoex.exchange_vec_offset", FT_UINT32, BASE_DEC,
NULL, 0x0, NULL, HFILL}},
{ &hf_negoex_exchange_vector_count,
{ "ExchangeByteCount", "negoex.exchange_vec_byte_count", FT_UINT16,
{ "ExchangeByteCount", "negoex.exchange_vec_byte_count", FT_UINT16,
BASE_DEC, NULL, 0x0, NULL, HFILL}},
{ &hf_negoex_exchange_vector_pad,
{ "ExchangePad", "negoex.exchange_vec_pad", FT_BYTES, BASE_NONE,

View File

@ -1,6 +1,6 @@
/* packet-sdh.c
* Routines for SDH/SONET encapsulation dissection
*
*
* $Id$
*
* Wireshark - Network traffic analyzer
@ -71,9 +71,9 @@ static gint sdh_data_rate = 1;
static enum_val_t data_rates[] = {
{"Attempt to guess", "Attempt to guess", -1},
{"OC-3", "OC-3", 1},
{"OC-12", "OC-12", 4},
{"OC-24", "OC-24", 8},
{"OC-3", "OC-3", 1},
{"OC-12", "OC-12", 4},
{"OC-24", "OC-24", 8},
{"OC-48", "OC-48", 16},
{NULL, NULL, -1}
};
@ -84,7 +84,7 @@ get_sdh_level(tvbuff_t *tvb)
/*data rate has been set in the SHD options*/
if(sdh_data_rate != -1) return sdh_data_rate;
/*returns the multiplier for each data level*/
switch(tvb_length(tvb)){
switch(tvb_reported_length(tvb)){
case 2430: /*OC-3*/
return 1;
case 9720: /*OC-12*/
@ -101,106 +101,109 @@ get_sdh_level(tvbuff_t *tvb)
static void
dissect_sdh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *sdh_tree = NULL;
proto_item *sdh_item = NULL;
int level = get_sdh_level(tvb);
guint32 a1 = 0;
guint32 a2 = 0;
guint8 j0 = 0;
guint8 b1 = 0;
guint8 e1 = 0;
guint8 f1 = 0;
guint8 d1 = 0;
guint8 d2 = 0;
guint8 d3 = 0;
guint8 h1 = 0;
guint8 h2 = 0;
guint16 au = 0;
guint32 b2 = 0;
guint8 k1 = 0;
guint8 k2 = 0;
guint8 d4 = 0;
guint8 d5 = 0;
guint8 d6 = 0;
guint8 d7 = 0;
guint8 d8 = 0;
guint8 d9 = 0;
guint8 d10 = 0;
guint8 d11 = 0;
guint8 d12 = 0;
guint8 s1 = 0;
guint8 m1 = 0;
guint8 e2 = 0;
guint8 j1 = 0;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SDH");
col_clear(pinfo->cinfo,COL_INFO);
if (tree) {
proto_tree *sdh_tree;
proto_item *sdh_item;
int level = get_sdh_level(tvb);
guint32 a1;
guint32 a2;
guint8 j0;
guint8 b1;
guint8 e1;
guint8 f1;
guint8 d1;
guint8 d2;
guint8 d3;
guint8 h1;
guint8 h2;
guint16 au;
guint32 b2;
guint8 k1;
guint8 k2;
guint8 d4;
guint8 d5;
guint8 d6;
guint8 d7;
guint8 d8;
guint8 d9;
guint8 d10;
guint8 d11;
guint8 d12;
guint8 s1;
guint8 m1;
guint8 e2;
guint8 j1;
sdh_item = proto_tree_add_protocol_format(tree, proto_sdh, tvb, 0, -1, "SDH");
sdh_tree = proto_item_add_subtree(sdh_item, ett_sdh);
a1 = tvb_get_ntoh24(tvb, 0+(0*level*COLUMNS));
a2 = tvb_get_ntoh24(tvb, 3+(0*level*COLUMNS));
j0 = tvb_get_guint8(tvb, 6+(0*level*COLUMNS));
b1 = tvb_get_guint8(tvb, 0+(1*level*COLUMNS));
e1 = tvb_get_guint8(tvb, 3+(1*level*COLUMNS));
f1 = tvb_get_guint8(tvb, 6+(1*level*COLUMNS));
d1 = tvb_get_guint8(tvb, 0+(2*level*COLUMNS));
d2 = tvb_get_guint8(tvb, 3+(2*level*COLUMNS));
d3 = tvb_get_guint8(tvb, 6+(2*level*COLUMNS));
h1 = tvb_get_guint8(tvb, 0+(3*level*COLUMNS));
h2 = tvb_get_guint8(tvb, 3+(3*level*COLUMNS));
au = (h2 | ((0x03 & h1) << 8));
b2 = 0;
b2 = tvb_get_guint8(tvb, 0+(4*level*COLUMNS)) << 16;
b2 = tvb_get_guint8(tvb, (1*level)+(4*level*COLUMNS)) << 8;
b2 = tvb_get_guint8(tvb, (2*level)+(4*level*COLUMNS));
k1 = tvb_get_guint8(tvb, 3+(4*level*COLUMNS));
k2 = tvb_get_guint8(tvb, 6+(4*level*COLUMNS));
d4 = tvb_get_guint8(tvb, 0+(5*level*COLUMNS));
d5 = tvb_get_guint8(tvb, 3+(5*level*COLUMNS));
d6 = tvb_get_guint8(tvb, 6+(5*level*COLUMNS));
d7 = tvb_get_guint8(tvb, 0+(6*level*COLUMNS));
d8 = tvb_get_guint8(tvb, 3+(6*level*COLUMNS));
d9 = tvb_get_guint8(tvb, 6+(6*level*COLUMNS));
a1 = tvb_get_ntoh24(tvb, 0+(0*level*COLUMNS));
a2 = tvb_get_ntoh24(tvb, 3+(0*level*COLUMNS));
j0 = tvb_get_guint8(tvb, 6+(0*level*COLUMNS));
b1 = tvb_get_guint8(tvb, 0+(1*level*COLUMNS));
e1 = tvb_get_guint8(tvb, 3+(1*level*COLUMNS));
f1 = tvb_get_guint8(tvb, 6+(1*level*COLUMNS));
d1 = tvb_get_guint8(tvb, 0+(2*level*COLUMNS));
d2 = tvb_get_guint8(tvb, 3+(2*level*COLUMNS));
d3 = tvb_get_guint8(tvb, 6+(2*level*COLUMNS));
h1 = tvb_get_guint8(tvb, 0+(3*level*COLUMNS));
h2 = tvb_get_guint8(tvb, 3+(3*level*COLUMNS));
au = (h2 | ((0x03 & h1) << 8));
b2 = 0;
b2 = tvb_get_guint8(tvb, 0+(4*level*COLUMNS)) << 16;
b2 = tvb_get_guint8(tvb, (1*level)+(4*level*COLUMNS)) << 8;
b2 = tvb_get_guint8(tvb, (2*level)+(4*level*COLUMNS));
k1 = tvb_get_guint8(tvb, 3+(4*level*COLUMNS));
k2 = tvb_get_guint8(tvb, 6+(4*level*COLUMNS));
d4 = tvb_get_guint8(tvb, 0+(5*level*COLUMNS));
d5 = tvb_get_guint8(tvb, 3+(5*level*COLUMNS));
d6 = tvb_get_guint8(tvb, 6+(5*level*COLUMNS));
d7 = tvb_get_guint8(tvb, 0+(6*level*COLUMNS));
d8 = tvb_get_guint8(tvb, 3+(6*level*COLUMNS));
d9 = tvb_get_guint8(tvb, 6+(6*level*COLUMNS));
d10 = tvb_get_guint8(tvb, 0+(7*level*COLUMNS));
d11 = tvb_get_guint8(tvb, 3+(7*level*COLUMNS));
d12 = tvb_get_guint8(tvb, 6+(7*level*COLUMNS));
s1 = tvb_get_guint8(tvb, 0+(8*level*COLUMNS));
m1 = tvb_get_guint8(tvb, 5+(8*level*COLUMNS));
e2 = tvb_get_guint8(tvb, 6+(8*level*COLUMNS));
s1 = tvb_get_guint8(tvb, 0+(8*level*COLUMNS));
m1 = tvb_get_guint8(tvb, 5+(8*level*COLUMNS));
e2 = tvb_get_guint8(tvb, 6+(8*level*COLUMNS));
j1 = tvb_get_guint8(tvb, au);
proto_tree_add_uint_format(sdh_tree, hf_sdh_a1, tvb, 0, 3, a1, "A1 %x", a1);
proto_tree_add_uint_format(sdh_tree, hf_sdh_a2, tvb, 3, 3, a2, "A2 %x", a2);
proto_tree_add_uint_format(sdh_tree, hf_sdh_j0, tvb, 6, 1, j0, "J0 %d", j0);
proto_tree_add_uint_format(sdh_tree, hf_sdh_b1, tvb, 0+(1*level*COLUMNS), 1, b1, "B1 %d", b1);
proto_tree_add_uint_format(sdh_tree, hf_sdh_e1, tvb, 3+(1*level*COLUMNS), 1, e1, "E1 %d", e1);
proto_tree_add_uint_format(sdh_tree, hf_sdh_f1, tvb, 6+(1*level*COLUMNS), 1, f1, "F1 %d", f1);
proto_tree_add_uint_format(sdh_tree, hf_sdh_d1, tvb, 0+(2*level*COLUMNS), 1, d1, "D1 %d", d1);
proto_tree_add_uint_format(sdh_tree, hf_sdh_d2, tvb, 3+(2*level*COLUMNS), 1, d2, "D2 %d", d2);
proto_tree_add_uint_format(sdh_tree, hf_sdh_d3, tvb, 6+(2*level*COLUMNS), 1, d3, "D3 %d", d3);
proto_tree_add_uint_format(sdh_tree, hf_sdh_au, tvb, 0+(3*level*COLUMNS), 9, au, "AU pointer %d h1 %d, h2 %d", au, h1, h2);
proto_tree_add_uint_format(sdh_tree, hf_sdh_b2, tvb, 0+(4*level*COLUMNS), 1, b2, "B2 %d", b2);
proto_tree_add_uint_format(sdh_tree, hf_sdh_k1, tvb, 3+(4*level*COLUMNS), 1, k1, "K1 %d", k1);
proto_tree_add_uint_format(sdh_tree, hf_sdh_k2, tvb, 6+(4*level*COLUMNS), 1, k2, "K2 %d", k2);
proto_tree_add_uint_format(sdh_tree, hf_sdh_d4, tvb, 0+(5*level*COLUMNS), 1, d4, "D4 %d", d4);
proto_tree_add_uint_format(sdh_tree, hf_sdh_d5, tvb, 3+(5*level*COLUMNS), 1, d5, "D5 %d", d5);
proto_tree_add_uint_format(sdh_tree, hf_sdh_d6, tvb, 6+(5*level*COLUMNS), 1, d6, "D6 %d", d6);
proto_tree_add_uint_format(sdh_tree, hf_sdh_d7, tvb, 0+(6*level*COLUMNS), 1, d7, "D7 %d", d7);
proto_tree_add_uint_format(sdh_tree, hf_sdh_d8, tvb, 3+(6*level*COLUMNS), 1, d8, "D8 %d", d8);
proto_tree_add_uint_format(sdh_tree, hf_sdh_d9, tvb, 6+(6*level*COLUMNS), 1, d9, "D9 %d", d9);
proto_tree_add_uint_format(sdh_tree, hf_sdh_a1, tvb, 0, 3, a1, "A1 %x", a1);
proto_tree_add_uint_format(sdh_tree, hf_sdh_a2, tvb, 3, 3, a2, "A2 %x", a2);
proto_tree_add_uint_format(sdh_tree, hf_sdh_j0, tvb, 6, 1, j0, "J0 %d", j0);
proto_tree_add_uint_format(sdh_tree, hf_sdh_b1, tvb, 0+(1*level*COLUMNS), 1, b1, "B1 %d", b1);
proto_tree_add_uint_format(sdh_tree, hf_sdh_e1, tvb, 3+(1*level*COLUMNS), 1, e1, "E1 %d", e1);
proto_tree_add_uint_format(sdh_tree, hf_sdh_f1, tvb, 6+(1*level*COLUMNS), 1, f1, "F1 %d", f1);
proto_tree_add_uint_format(sdh_tree, hf_sdh_d1, tvb, 0+(2*level*COLUMNS), 1, d1, "D1 %d", d1);
proto_tree_add_uint_format(sdh_tree, hf_sdh_d2, tvb, 3+(2*level*COLUMNS), 1, d2, "D2 %d", d2);
proto_tree_add_uint_format(sdh_tree, hf_sdh_d3, tvb, 6+(2*level*COLUMNS), 1, d3, "D3 %d", d3);
proto_tree_add_uint_format(sdh_tree, hf_sdh_au, tvb, 0+(3*level*COLUMNS), 9, au, "AU pointer %d h1 %d, h2 %d", au, h1, h2);
proto_tree_add_uint_format(sdh_tree, hf_sdh_b2, tvb, 0+(4*level*COLUMNS), 1, b2, "B2 %d", b2);
proto_tree_add_uint_format(sdh_tree, hf_sdh_k1, tvb, 3+(4*level*COLUMNS), 1, k1, "K1 %d", k1);
proto_tree_add_uint_format(sdh_tree, hf_sdh_k2, tvb, 6+(4*level*COLUMNS), 1, k2, "K2 %d", k2);
proto_tree_add_uint_format(sdh_tree, hf_sdh_d4, tvb, 0+(5*level*COLUMNS), 1, d4, "D4 %d", d4);
proto_tree_add_uint_format(sdh_tree, hf_sdh_d5, tvb, 3+(5*level*COLUMNS), 1, d5, "D5 %d", d5);
proto_tree_add_uint_format(sdh_tree, hf_sdh_d6, tvb, 6+(5*level*COLUMNS), 1, d6, "D6 %d", d6);
proto_tree_add_uint_format(sdh_tree, hf_sdh_d7, tvb, 0+(6*level*COLUMNS), 1, d7, "D7 %d", d7);
proto_tree_add_uint_format(sdh_tree, hf_sdh_d8, tvb, 3+(6*level*COLUMNS), 1, d8, "D8 %d", d8);
proto_tree_add_uint_format(sdh_tree, hf_sdh_d9, tvb, 6+(6*level*COLUMNS), 1, d9, "D9 %d", d9);
proto_tree_add_uint_format(sdh_tree, hf_sdh_d10, tvb, 0+(7*level*COLUMNS), 1, d10, "D10 %d", d10);
proto_tree_add_uint_format(sdh_tree, hf_sdh_d11, tvb, 3+(7*level*COLUMNS), 1, d11, "D11 %d", d11);
proto_tree_add_uint_format(sdh_tree, hf_sdh_d12, tvb, 6+(7*level*COLUMNS), 1, d12, "D12 %d", d12);
proto_tree_add_uint_format(sdh_tree, hf_sdh_s1, tvb, 0+(8*level*COLUMNS), 1, s1, "S1 %d", s1);
proto_tree_add_uint_format(sdh_tree, hf_sdh_m1, tvb, 5+(8*level*COLUMNS), 1, m1, "M1 %d", m1);
proto_tree_add_uint_format(sdh_tree, hf_sdh_e2, tvb, 6+(7*level*COLUMNS), 1, e2, "E2 %d", e2);
proto_tree_add_uint_format(sdh_tree, hf_sdh_s1, tvb, 0+(8*level*COLUMNS), 1, s1, "S1 %d", s1);
proto_tree_add_uint_format(sdh_tree, hf_sdh_m1, tvb, 5+(8*level*COLUMNS), 1, m1, "M1 %d", m1);
proto_tree_add_uint_format(sdh_tree, hf_sdh_e2, tvb, 6+(7*level*COLUMNS), 1, e2, "E2 %d", e2);
proto_tree_add_uint_format(sdh_tree, hf_sdh_j1, tvb, au, 1, j1, "J1 %d", j1);
proto_tree_add_uint_format(sdh_tree, hf_sdh_j1, tvb, au, 1, j1, "J1 %d", j1);
}
}
void
@ -265,7 +268,7 @@ proto_register_sdh(void)
};
module_t *sdh_module;
proto_sdh = proto_register_protocol("SDH/SONET Protocol", "SDH", "sdh");
proto_register_field_array(proto_sdh, hf, array_length(hf));
@ -284,7 +287,7 @@ void
proto_reg_handoff_sdh(void)
{
dissector_handle_t sdh_handle;
sdh_handle = find_dissector("sdh");
dissector_add_uint("wtap_encap", WTAP_ENCAP_SDH, sdh_handle);

View File

@ -32,7 +32,6 @@
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/tvbuff.h>
#include <epan/strutil.h>
#include <epan/dissectors/packet-tcp.h>
@ -85,19 +84,19 @@ void proto_reg_handoff_yami(void);
#define YAMI_TYPE_NESTED 13
static const value_string yami_param_type_vals[] = {
{ YAMI_TYPE_BOOLEAN, "boolean" },
{ YAMI_TYPE_INTEGER, "integer" },
{ YAMI_TYPE_LONGLONG, "long long" },
{ YAMI_TYPE_DOUBLE, "double" },
{ YAMI_TYPE_STRING, "string" },
{ YAMI_TYPE_BINARY, "binary" },
{ YAMI_TYPE_BOOLEAN_ARRAY, "boolean array" },
{ YAMI_TYPE_INTEGER_ARRAY, "integer array" },
{ YAMI_TYPE_BOOLEAN, "boolean" },
{ YAMI_TYPE_INTEGER, "integer" },
{ YAMI_TYPE_LONGLONG, "long long" },
{ YAMI_TYPE_DOUBLE, "double" },
{ YAMI_TYPE_STRING, "string" },
{ YAMI_TYPE_BINARY, "binary" },
{ YAMI_TYPE_BOOLEAN_ARRAY, "boolean array" },
{ YAMI_TYPE_INTEGER_ARRAY, "integer array" },
{ YAMI_TYPE_LONGLONG_ARRAY, "long long array" },
{ YAMI_TYPE_DOUBLE_ARRAY, "double array" },
{ YAMI_TYPE_STRING_ARRAY, "string array" },
{ YAMI_TYPE_BINARY_ARRAY, "binary array" },
{ YAMI_TYPE_NESTED, "nested parameters" },
{ YAMI_TYPE_DOUBLE_ARRAY, "double array" },
{ YAMI_TYPE_STRING_ARRAY, "string array" },
{ YAMI_TYPE_BINARY_ARRAY, "binary array" },
{ YAMI_TYPE_NESTED, "nested parameters" },
{ 0, NULL }
};
@ -192,7 +191,7 @@ dissect_yami_parameter(tvbuff_t *tvb, proto_tree *tree, int offset, proto_item *
guint32 val_len;
const guint8 *val;
char *repr;
val_len = tvb_get_letohl(tvb, offset);
offset += 4;
@ -413,7 +412,7 @@ dissect_yami_data(tvbuff_t *tvb, gboolean data, proto_tree *tree, int offset)
ti = proto_tree_add_item(tree, (data) ? hf_yami_message_data : hf_yami_message_hdr, tvb, offset, 0, ENC_NA);
yami_data_tree = proto_item_add_subtree(ti, (data) ? ett_yami_msg_data : ett_yami_msg_hdr);
count = tvb_get_letohl(tvb, offset);
proto_tree_add_item(yami_data_tree, hf_yami_params_count, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset += 4;
@ -493,7 +492,7 @@ dissect_yami_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
#define FRAME_HEADER_LEN 16
static guint
static guint
get_yami_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
{
guint32 len = tvb_get_letohl(tvb, offset + 12);
@ -508,7 +507,7 @@ dissect_yami(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
return tvb_length(tvb);
}
void
void
proto_register_yami(void)
{
static hf_register_info hf[] = {
@ -567,7 +566,7 @@ proto_register_yami(void)
}
};
static gint *ett[] = {
static gint *ett[] = {
&ett_yami,
&ett_yami_msg_hdr,
&ett_yami_msg_data,
@ -591,7 +590,7 @@ proto_register_yami(void)
&yami_desegment);
}
void
void
proto_reg_handoff_yami(void)
{
static dissector_handle_t yami_handle;