Create a new REP_NA value for fields where there are no representations

from which to choose; use that for protocol fields in some protocols
(modify the CORBA generator to use it, and manually update the generated
CORBA dissectors accordingly).

svn path=/trunk/; revision=32777
This commit is contained in:
Guy Harris 2010-05-13 00:20:40 +00:00
parent 308bb550da
commit 998677339e
17 changed files with 27 additions and 19 deletions

View File

@ -845,7 +845,7 @@ dissect_asap(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
necessary to generate protocol tree items. */
if (tree) {
/* create the asap protocol tree */
asap_item = proto_tree_add_item(tree, proto_asap, message_tvb, 0, -1, FALSE);
asap_item = proto_tree_add_item(tree, proto_asap, message_tvb, 0, -1, REP_NA);
asap_tree = proto_item_add_subtree(asap_item, ett_asap);
} else {
asap_tree = NULL;

View File

@ -696,7 +696,7 @@ dissect_dua(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
necessary to generate protocol tree items. */
if (tree) {
/* create the m3ua protocol tree */
dua_item = proto_tree_add_item(tree, proto_dua, message_tvb, 0, -1, FALSE);
dua_item = proto_tree_add_item(tree, proto_dua, message_tvb, 0, -1, REP_NA);
dua_tree = proto_item_add_subtree(dua_item, ett_dua);
} else {
dua_tree = NULL;

View File

@ -1003,7 +1003,7 @@ dissect_enrp(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
necessary to generate protocol tree items. */
if (tree) {
/* create the enrp protocol tree */
enrp_item = proto_tree_add_item(tree, proto_enrp, message_tvb, 0, -1, FALSE);
enrp_item = proto_tree_add_item(tree, proto_enrp, message_tvb, 0, -1, REP_NA);
enrp_tree = proto_item_add_subtree(enrp_item, ett_enrp);
} else {
enrp_tree = NULL;

View File

@ -888,7 +888,7 @@ dissect_iua(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
necessary to generate protocol tree items. */
if (tree) {
/* create the m3ua protocol tree */
iua_item = proto_tree_add_item(tree, proto_iua, message_tvb, 0, -1, FALSE);
iua_item = proto_tree_add_item(tree, proto_iua, message_tvb, 0, -1, REP_NA);
iua_tree = proto_item_add_subtree(iua_item, ett_iua);
} else {
iua_tree = NULL;

View File

@ -532,7 +532,7 @@ dissect_m2pa(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
};
if (tree) {
m2pa_item = proto_tree_add_item(tree, proto_m2pa, tvb, 0, -1, FALSE);
m2pa_item = proto_tree_add_item(tree, proto_m2pa, tvb, 0, -1, REP_NA);
m2pa_tree = proto_item_add_subtree(m2pa_item, ett_m2pa);
} else {
m2pa_item = NULL;

View File

@ -1059,7 +1059,7 @@ dissect_m2ua(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
necessary to generate protocol tree items. */
if (tree) {
/* create the m2ua protocol tree */
m2ua_item = proto_tree_add_item(tree, proto_m2ua, message_tvb, 0, -1, FALSE);
m2ua_item = proto_tree_add_item(tree, proto_m2ua, message_tvb, 0, -1, REP_NA);
m2ua_tree = proto_item_add_subtree(m2ua_item, ett_m2ua);
} else {
m2ua_tree = NULL;

View File

@ -1963,7 +1963,7 @@ dissect_m3ua(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
necessary to generate protocol tree items. */
if (tree) {
/* create the m3ua protocol tree */
m3ua_item = proto_tree_add_item(tree, proto_m3ua, message_tvb, 0, -1, FALSE);
m3ua_item = proto_tree_add_item(tree, proto_m3ua, message_tvb, 0, -1, REP_NA);
m3ua_tree = proto_item_add_subtree(m3ua_item, ett_m3ua);
} else {
m3ua_tree = NULL;

View File

@ -1276,7 +1276,7 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree)
{
ti = proto_tree_add_item(tree, proto_mq, tvb, offset, -1, FALSE);
ti = proto_tree_add_item(tree, proto_mq, tvb, offset, -1, REP_NA);
proto_item_append_text(ti, " (%s)", val_to_str(opcode, mq_opcode_vals, "Unknown (0x%02x)"));
if (bEBCDIC == TRUE) proto_item_append_text(ti, " (EBCDIC)");
mqroot_tree = proto_item_add_subtree(ti, ett_mq);
@ -2300,7 +2300,7 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_append_str(pinfo->cinfo, COL_INFO, " [Undesegmented]");
if (tree)
{
proto_tree_add_item(tree, proto_mq, tvb, offset, -1, FALSE);
proto_tree_add_item(tree, proto_mq, tvb, offset, -1, REP_NA);
}
call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo, tree);
}
@ -2367,7 +2367,7 @@ reassemble_mq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree)
{
proto_item* ti = NULL;
ti = proto_tree_add_item(tree, proto_mq, tvb, 0, -1, FALSE);
ti = proto_tree_add_item(tree, proto_mq, tvb, 0, -1, REP_NA);
proto_item_append_text(ti, " (%s) [Reassembled MQ]", val_to_str(opcode, mq_opcode_vals, "Unknown (0x%02x)"));
}
return;

View File

@ -345,7 +345,7 @@ dissect_mtp2_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolea
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP2");
if (tree) {
mtp2_item = proto_tree_add_item(tree, proto_mtp2, tvb, 0, -1, FALSE);
mtp2_item = proto_tree_add_item(tree, proto_mtp2, tvb, 0, -1, REP_NA);
mtp2_tree = proto_item_add_subtree(mtp2_item, ett_mtp2);
};

View File

@ -3695,7 +3695,7 @@ dissect_sctp_chunks(tvbuff_t *tvb,
offset += total_length;
last_offset = offset;
if (tvb_reported_length_remaining(tvb, offset) > 0) {
sctp_item = proto_tree_add_item(tree, proto_sctp, tvb, offset, -1, FALSE);
sctp_item = proto_tree_add_item(tree, proto_sctp, tvb, offset, -1, REP_NA);
sctp_tree = proto_item_add_subtree(sctp_item, ett_sctp);
sctp_item_length_set = FALSE;
}
@ -3774,7 +3774,7 @@ dissect_sctp_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolea
get_sctp_port(source_port), source_port,
get_sctp_port(destination_port), destination_port);
else
sctp_item = proto_tree_add_item(tree, proto_sctp, tvb, 0, -1, FALSE);
sctp_item = proto_tree_add_item(tree, proto_sctp, tvb, 0, -1, REP_NA);
sctp_tree = proto_item_add_subtree(sctp_item, ett_sctp);
/* add the components of the common header to the protocol tree */

View File

@ -1965,7 +1965,7 @@ dissect_sua(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
necessary to generate protocol tree items. */
if (tree) {
/* create the sua protocol tree */
sua_item = proto_tree_add_item(tree, proto_sua, message_tvb, 0, -1, FALSE);
sua_item = proto_tree_add_item(tree, proto_sua, message_tvb, 0, -1, REP_NA);
sua_tree = proto_item_add_subtree(sua_item, ett_sua);
} else {
sua_tree = NULL;

View File

@ -187,10 +187,18 @@ typedef struct _protocol protocol_t;
* REP_LITTLE_ENDIAN as 0x80000000 - we're using the high-order bit
* so that we could put a field type and/or a value such as a character
* encoding in the lower bits.
*
* For protocols (FT_PROTOCOL), aggregate items with subtrees (FT_NONE),
* opaque byte-array fields (FT_BYTES), and other fields where there
* is no choice of representation (either because it's "just a bucket
* of bytes" or because the representation is completely fixed), we
* have REP_NA (for "Not Applicable").
*/
#define REP_BIG_ENDIAN 0x00000000
#define REP_LITTLE_ENDIAN 0x80000000
#define REP_NA 0x00000000
/* Values for header_field_info.display */
/* For integral types, the display format is a base_display_e value

View File

@ -613,7 +613,7 @@ static proto_tree *start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tre
*/
if (ptree) {
ti = proto_tree_add_item(ptree, proto_coseventcomm, tvb, *offset, -1, FALSE);
ti = proto_tree_add_item(ptree, proto_coseventcomm, tvb, *offset, -1, REP_NA);
tree = proto_item_add_subtree(ti, ett_coseventcomm);
}
return tree;

View File

@ -1560,7 +1560,7 @@ static proto_tree *start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tre
*/
if (ptree) {
ti = proto_tree_add_item(ptree, proto_cosnaming, tvb, *offset, -1, FALSE);
ti = proto_tree_add_item(ptree, proto_cosnaming, tvb, *offset, -1, REP_NA);
tree = proto_item_add_subtree(ti, ett_cosnaming);
}
return tree;

View File

@ -101303,7 +101303,7 @@ static proto_tree *start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tre
*/
if (ptree) {
ti = proto_tree_add_item(ptree, proto_parlay, tvb, *offset, -1, FALSE);
ti = proto_tree_add_item(ptree, proto_parlay, tvb, *offset, -1, REP_NA);
tree = proto_item_add_subtree(ti, ett_parlay);
}
return tree;

View File

@ -4239,7 +4239,7 @@ static proto_tree *start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tre
*/
if (ptree) {
ti = proto_tree_add_item(ptree, proto_tango, tvb, *offset, -1, FALSE);
ti = proto_tree_add_item(ptree, proto_tango, tvb, *offset, -1, REP_NA);
tree = proto_item_add_subtree(ti, ett_tango);
}
return tree;

View File

@ -2145,7 +2145,7 @@ static proto_tree *start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tre
*/
if (ptree) {
ti = proto_tree_add_item(ptree, proto_@dissname@, tvb, *offset, -1, FALSE);
ti = proto_tree_add_item(ptree, proto_@dissname@, tvb, *offset, -1, REP_NA);
tree = proto_item_add_subtree(ti, ett_@dissname@);
}
return tree;