aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/dcerpc
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-05-14 23:05:28 +0000
committerGuy Harris <guy@alum.mit.edu>2012-05-14 23:05:28 +0000
commit953a5c3fff1183651f071733ddf097f76a5eee6d (patch)
tree785ea839af47ff852f61cad42cf5e74d06085c16 /epan/dissectors/dcerpc
parent05cfd1c3914cd44336a527708e36dce94d9f134e (diff)
Get rid of remaining Booleans-as-encoding-arguments in
proto_tree_add_item() calls. Change the "idl-light"-to-dissector generator to use ENC_NA for structures and ENC_LITTLE_ENDIAN for bitmasks (are they always little-endian, or should they check the data representation?). Also change it to properly set the display format for FT_ABSOLUTE_TIME fields (it now specifies whether to show local time, UTC, or UTC with a 1-origin day-of-year). Change one routine in the template for the DRSUAPI dissector to use ENC_UTF_16|ENC_LITTLE_ENDIAN with proto_tree_add_item() (the field it dissects is known to be a string, so there's no need to check its data type). Regenerate the BUDB, BUTC, and DRSUAPI dissectors. (The generated BUTC dissector handles pointers differently - either the old dissector was wrong, or the generator is wrong, or the IDL for the protocol is wrong, or the difference doesn't actually affect dissection.) The generator doesn't currently handle hex values in enums correctly; manually fix packet-dcerpc-drsuapi.h. svn path=/trunk/; revision=42625
Diffstat (limited to 'epan/dissectors/dcerpc')
-rw-r--r--epan/dissectors/dcerpc/drsuapi/packet-dcerpc-drsuapi-template.c13
-rw-r--r--epan/dissectors/dcerpc/idl2wrs.c12
2 files changed, 8 insertions, 17 deletions
diff --git a/epan/dissectors/dcerpc/drsuapi/packet-dcerpc-drsuapi-template.c b/epan/dissectors/dcerpc/drsuapi/packet-dcerpc-drsuapi-template.c
index fbc29754c5..50d726df77 100644
--- a/epan/dissectors/dcerpc/drsuapi/packet-dcerpc-drsuapi-template.c
+++ b/epan/dissectors/dcerpc/drsuapi/packet-dcerpc-drsuapi-template.c
@@ -49,10 +49,8 @@ ETH_ETT
static int
ucarray_drsuapi_dissect_DsReplicaSyncRequest1Info_nc_dn(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
{
- header_field_info *hfinfo;
static guint32 len;
dcerpc_info *di;
- char *s;
int old_offset;
di=pinfo->private_data;
@@ -72,16 +70,9 @@ ucarray_drsuapi_dissect_DsReplicaSyncRequest1Info_nc_dn(tvbuff_t *tvb, int offse
ALIGN_TO_2_BYTES;
- s = tvb_get_unicode_string(tvb, offset, len*2, ENC_LITTLE_ENDIAN);
if (tree && len) {
- hfinfo = proto_registrar_get_nth(hf_drsuapi_DsReplicaSyncRequest1Info_nc_dn);
- if (hfinfo->type == FT_STRING) {
- proto_tree_add_string(tree, hf_drsuapi_DsReplicaSyncRequest1Info_nc_dn, tvb, offset,
- len, s);
- } else {
- proto_tree_add_item(tree, hf_drsuapi_DsReplicaSyncRequest1Info_nc_dn, tvb, offset,
- len, DREP_ENC_INTEGER(drep));
- }
+ proto_tree_add_item(tree, hf_drsuapi_DsReplicaSyncRequest1Info_nc_dn, tvb, offset,
+ len*2, ENC_UTF_16|ENC_LITTLE_ENDIAN);
}
offset+=2*len;
diff --git a/epan/dissectors/dcerpc/idl2wrs.c b/epan/dissectors/dcerpc/idl2wrs.c
index ada09deb31..174adc31c5 100644
--- a/epan/dissectors/dcerpc/idl2wrs.c
+++ b/epan/dissectors/dcerpc/idl2wrs.c
@@ -1219,7 +1219,7 @@ find_type(char *name)
FPRINTF(eth_code, " return offset;\n");
FPRINTF(eth_code, "}\n");
FPRINTF(eth_code, "\n");
- tmptype=register_new_type("NTTIME", dissectorname, "FT_ABSOLUTE_TIME", "BASE_NONE", "0", "NULL", 4);
+ tmptype=register_new_type("NTTIME", dissectorname, "FT_ABSOLUTE_TIME", "ABSOLUTE_TIME_LOCAL", "0", "NULL", 4);
} else if(!strcmp(name,"NTTIME_hyper")){
/* 8 bytes, aligned to 8 bytes */
sprintf(dissectorname, "%s_dissect_%s", ifname, name);
@@ -1235,7 +1235,7 @@ find_type(char *name)
FPRINTF(eth_code, " return offset;\n");
FPRINTF(eth_code, "}\n");
FPRINTF(eth_code, "\n");
- tmptype=register_new_type("NTTIME_hyper", dissectorname, "FT_ABSOLUTE_TIME", "BASE_NONE", "0", "NULL", 4);
+ tmptype=register_new_type("NTTIME_hyper", dissectorname, "FT_ABSOLUTE_TIME", "ABSOLUTE_TIME_LOCAL", "0", "NULL", 4);
} else if(!strcmp(name,"NTTIME_1sec")){
/* 8 bytes, aligned to 8 bytes */
sprintf(dissectorname, "%s_dissect_%s", ifname, name);
@@ -1251,7 +1251,7 @@ find_type(char *name)
FPRINTF(eth_code, " return offset;\n");
FPRINTF(eth_code, "}\n");
FPRINTF(eth_code, "\n");
- tmptype=register_new_type("NTTIME_1sec", dissectorname, "FT_ABSOLUTE_TIME", "BASE_NONE", "0", "NULL", 4);
+ tmptype=register_new_type("NTTIME_1sec", dissectorname, "FT_ABSOLUTE_TIME", "ABSOLUTE_TIME_LOCAL", "0", "NULL", 4);
} else if(!strcmp(name,"udlong")){
/* 8 bytes, aligned to 4 bytes */
sprintf(dissectorname, "%s_dissect_%s", ifname, name);
@@ -1311,7 +1311,7 @@ find_type(char *name)
FPRINTF(eth_code, " return offset;\n");
FPRINTF(eth_code, "}\n");
FPRINTF(eth_code, "\n");
- tmptype=register_new_type("time_t", dissectorname, "FT_ABSOLUTE_TIME", "BASE_NONE", "0", "NULL", 4);
+ tmptype=register_new_type("time_t", dissectorname, "FT_ABSOLUTE_TIME", "ABSOLUTE_TIME_LOCAL", "0", "NULL", 4);
} else if(!strcmp(name,"SID")){
sprintf(dissectorname, "%s_dissect_%s", ifname, name);
FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name);
@@ -1553,7 +1553,7 @@ static void parsetypedefstruct(int pass)
}
FPRINTF(eth_code, " old_offset=offset;\n");
FPRINTF(eth_code, " if(parent_tree){\n");
- FPRINTF(eth_code, " item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);\n");
+ FPRINTF(eth_code, " item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);\n");
FPRINTF(eth_code, " tree=proto_item_add_subtree(item, ett_%s_%s);\n", ifname, struct_name);
FPRINTF(eth_code, " }\n");
FPRINTF(eth_code, "\n");
@@ -1988,7 +1988,7 @@ static void parsetypedefbitmap(int pass)
}
FPRINTF(eth_code, "\n");
FPRINTF(eth_code, " if(parent_tree){\n");
- FPRINTF(eth_code, " item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, %d, TRUE);\n", alignment);
+ FPRINTF(eth_code, " item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, %d, ENC_LITTLE_ENDIAN);\n", alignment);
FPRINTF(eth_code, " tree=proto_item_add_subtree(item, ett_%s_%s);\n", ifname, bitmap_name);
FPRINTF(eth_code, " }\n");
FPRINTF(eth_code, "\n");