sprintf(tmpstr, "%s_dissect_%s_%s", ifname, struct_name, field_name);
ptmpstr=strdup(tmpstr);
- sprintf(filter_name, "%s.%s.%s", ifname, struct_name, field_name);
- hf=register_hf_field(hf_index, field_name, filter_name, type_item->ft_type, type_item->base_type, type_item->vals, type_item->mask, "");
- FPRINTF(eth_code, "static int\n");
- FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)\n", ptmpstr);
- FPRINTF(eth_code, "{\n");
- FPRINTF(eth_code, " guint32 param=%s;\n",find_dissector_param_value(ptmpstr));
- FPRINTF(eth_code, " offset=%s(tvb, offset, pinfo, tree, drep, %s, param);\n", type_item->dissector, hf);
- FPRINTF(eth_code, " return offset;\n");
- FPRINTF(eth_code, "}\n");
- FPRINTF(eth_code, "\n");
+ if(check_if_to_emit(tmpstr)){
+ sprintf(filter_name, "%s.%s.%s", ifname, struct_name, field_name);
+ hf=register_hf_field(hf_index, field_name, filter_name, type_item->ft_type, type_item->base_type, type_item->vals, type_item->mask, "");
+ FPRINTF(eth_code, "static int\n");
+ FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)\n", ptmpstr);
+ FPRINTF(eth_code, "{\n");
+ FPRINTF(eth_code, " guint32 param=%s;\n",find_dissector_param_value(ptmpstr));
+ FPRINTF(eth_code, " offset=%s(tvb, offset, pinfo, tree, drep, %s, param);\n", type_item->dissector, hf);
+ FPRINTF(eth_code, " return offset;\n");
+ FPRINTF(eth_code, "}\n");
+ FPRINTF(eth_code, "\n");
+ } else {
+ FPRINTF(NULL,"NOEMIT Skipping this struct item :%s\n",tmpstr);
+ }
if(is_array_of_pointers){
pointer_type=pi->type;
pi=pi->next;
sprintf(tmpstr, "%s_%s", pointer_type, ptmpstr);
- FPRINTF(eth_code, "static int\n");
- FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)\n", tmpstr);
- FPRINTF(eth_code, "{\n");
- FPRINTF(eth_code, " offset=dissect_ndr_pointer(tvb, offset, pinfo, tree, drep, %s, %s, \"%s\", -1);\n", ptmpstr, ptr_to_define(pointer_type), field_name);
- FPRINTF(eth_code, " return offset;\n");
- FPRINTF(eth_code, "}\n");
- FPRINTF(eth_code, "\n");
+ if(check_if_to_emit(tmpstr)){
+ FPRINTF(eth_code, "static int\n");
+ FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)\n", tmpstr);
+ FPRINTF(eth_code, "{\n");
+ FPRINTF(eth_code, " offset=dissect_ndr_pointer(tvb, offset, pinfo, tree, drep, %s, %s, \"%s\", -1);\n", ptmpstr, ptr_to_define(pointer_type), field_name);
+ FPRINTF(eth_code, " return offset;\n");
+ FPRINTF(eth_code, "}\n");
+ FPRINTF(eth_code, "\n");
+ } else {
+ FPRINTF(NULL,"NOEMIT Skipping this struct item :%s\n",tmpstr);
+ }
ptmpstr=strdup(tmpstr);
} else if(fixed_array_size){
sprintf(tmpstr, "fixedarray_%s", ptmpstr);
- FPRINTF(eth_code, "static int\n");
- FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)\n", tmpstr);
- FPRINTF(eth_code, "{\n");
- FPRINTF(eth_code, " int count=%d;\n",fixed_array_size);
- FPRINTF(eth_code, " while(count--){\n");
- FPRINTF(eth_code, " offset=%s(tvb, offset, pinfo, tree, drep);\n", ptmpstr);
- FPRINTF(eth_code, " }\n");
- FPRINTF(eth_code, "\n");
- FPRINTF(eth_code, " return offset;\n");
- FPRINTF(eth_code, "}\n");
- FPRINTF(eth_code, "\n");
+ if(check_if_to_emit(tmpstr)){
+ FPRINTF(eth_code, "static int\n");
+ FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)\n", tmpstr);
+ FPRINTF(eth_code, "{\n");
+ FPRINTF(eth_code, " int count=%d;\n",fixed_array_size);
+ FPRINTF(eth_code, " while(count--){\n");
+ FPRINTF(eth_code, " offset=%s(tvb, offset, pinfo, tree, drep);\n", ptmpstr);
+ FPRINTF(eth_code, " }\n");
+ FPRINTF(eth_code, "\n");
+ FPRINTF(eth_code, " return offset;\n");
+ FPRINTF(eth_code, "}\n");
+ FPRINTF(eth_code, "\n");
+ } else {
+ FPRINTF(NULL,"NOEMIT Skipping this struct item :%s\n",tmpstr);
+ }
ptmpstr=strdup(tmpstr);
}
break;
case BI_SIZE_IS:
sprintf(tmpstr, "ucarray_%s", ptmpstr);
- FPRINTF(eth_code, "static int\n");
- FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)\n", tmpstr);
- FPRINTF(eth_code, "{\n");
- FPRINTF(eth_code, " offset=dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep, %s);\n", ptmpstr);
- FPRINTF(eth_code, " return offset;\n");
- FPRINTF(eth_code, "}\n");
- FPRINTF(eth_code, "\n");
+ if(check_if_to_emit(tmpstr)){
+ FPRINTF(eth_code, "static int\n");
+ FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)\n", tmpstr);
+ FPRINTF(eth_code, "{\n");
+ FPRINTF(eth_code, " offset=dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep, %s);\n", ptmpstr);
+ FPRINTF(eth_code, " return offset;\n");
+ FPRINTF(eth_code, "}\n");
+ FPRINTF(eth_code, "\n");
+ } else {
+ FPRINTF(NULL,"NOEMIT Skipping this struct item :%s\n",tmpstr);
+ }
ptmpstr=strdup(tmpstr);
break;
case BI_LENGTH_IS:
sprintf(tmpstr, "uvarray_%s", ptmpstr);
- FPRINTF(eth_code, "static int\n");
- FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)\n", tmpstr);
- FPRINTF(eth_code, "{\n");
- FPRINTF(eth_code, " offset=dissect_ndr_uvarray(tvb, offset, pinfo, tree, drep, %s);\n", ptmpstr);
- FPRINTF(eth_code, " return offset;\n");
- FPRINTF(eth_code, "}\n");
- FPRINTF(eth_code, "\n");
+ if(check_if_to_emit(tmpstr)){
+ FPRINTF(eth_code, "static int\n");
+ FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)\n", tmpstr);
+ FPRINTF(eth_code, "{\n");
+ FPRINTF(eth_code, " offset=dissect_ndr_uvarray(tvb, offset, pinfo, tree, drep, %s);\n", ptmpstr);
+ FPRINTF(eth_code, " return offset;\n");
+ FPRINTF(eth_code, "}\n");
+ FPRINTF(eth_code, "\n");
+ } else {
+ FPRINTF(NULL,"NOEMIT Skipping this struct item :%s\n",tmpstr);
+ }
ptmpstr=strdup(tmpstr);
break;
case BI_SIZE_IS|BI_LENGTH_IS:
sprintf(tmpstr, "ucvarray_%s", ptmpstr);
- FPRINTF(eth_code, "static int\n");
- FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)\n", tmpstr);
- FPRINTF(eth_code, "{\n");
- FPRINTF(eth_code, " offset=dissect_ndr_ucvarray(tvb, offset, pinfo, tree, drep, %s);\n", ptmpstr);
- FPRINTF(eth_code, " return offset;\n");
- FPRINTF(eth_code, "}\n");
- FPRINTF(eth_code, "\n");
+ if(check_if_to_emit(tmpstr)){
+ FPRINTF(eth_code, "static int\n");
+ FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)\n", tmpstr);
+ FPRINTF(eth_code, "{\n");
+ FPRINTF(eth_code, " offset=dissect_ndr_ucvarray(tvb, offset, pinfo, tree, drep, %s);\n", ptmpstr);
+ FPRINTF(eth_code, " return offset;\n");
+ FPRINTF(eth_code, "}\n");
+ FPRINTF(eth_code, "\n");
+ } else {
+ FPRINTF(NULL,"NOEMIT Skipping this struct item :%s\n",tmpstr);
+ }
ptmpstr=strdup(tmpstr);
break;
default:
pointer_type=pi->type;
pi=pi->next;
sprintf(tmpstr, "%s_%s", pointer_type, ptmpstr);
- FPRINTF(eth_code, "static int\n");
- FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)\n", tmpstr);
- FPRINTF(eth_code, "{\n");
- FPRINTF(eth_code, " offset=dissect_ndr_pointer(tvb, offset, pinfo, tree, drep, %s, %s, \"%s\", -1);\n", ptmpstr, ptr_to_define(pointer_type), field_name);
- FPRINTF(eth_code, " return offset;\n");
- FPRINTF(eth_code, "}\n");
- FPRINTF(eth_code, "\n");
+ if(check_if_to_emit(tmpstr)){
+ FPRINTF(eth_code, "static int\n");
+ FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)\n", tmpstr);
+ FPRINTF(eth_code, "{\n");
+ FPRINTF(eth_code, " offset=dissect_ndr_pointer(tvb, offset, pinfo, tree, drep, %s, %s, \"%s\", -1);\n", ptmpstr, ptr_to_define(pointer_type), field_name);
+ FPRINTF(eth_code, " return offset;\n");
+ FPRINTF(eth_code, "}\n");
+ FPRINTF(eth_code, "\n");
+ } else {
+ FPRINTF(NULL,"NOEMIT Skipping this struct item :%s\n",tmpstr);
+ }
ptmpstr=strdup(tmpstr);
}
#include "packet-dcerpc-drsuapi.h"
static int proto_drsuapi = -1;
+static int hf_drsuapi_DsReplicaSyncRequest1Info_nc_dn = -1;
/* INCLUDED FILE : ETH_HF */
static int hf_drsuapi_DsReplicaSyncRequest1Info_guid1 = -1;
static int hf_drsuapi_DsReplicaSyncRequest1Info_byte_array = -1;
static int hf_drsuapi_DsReplicaSyncRequest1Info_str_len = -1;
-static int hf_drsuapi_DsReplicaSyncRequest1Info_nc_dn = -1;
static int hf_drsuapi_DsReplicaSyncOptions_DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_OPERATION = -1;
static int hf_drsuapi_DsReplicaSyncOptions_DRSUAPI_DS_REPLICA_SYNC_WRITEABLE = -1;
static int hf_drsuapi_DsReplicaSyncOptions_DRSUAPI_DS_REPLICA_SYNC_PERIODIC = -1;
static int
-drsuapi_dissect_u_string(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_)
+ucarray_drsuapi_dissect_DsReplicaSyncRequest1Info_nc_dn(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
{
- offset=dissect_ndr_vstring(tvb, offset, pinfo, tree, drep, 2, hf_index, FALSE, NULL);
- return offset;
+ header_field_info *hfinfo;
+ static guint32 len;
+ dcerpc_info *di;
+ char *s;
+ int old_offset;
+
+ di=pinfo->private_data;
+ if(di->conformant_run){
+ /*just a run to handle conformant arrays, nothing to dissect
+ but we need to remember how long this array was.
+ see packet-dcerpc.c for examples of conformant_run
+ and what it is.
+ */
+ old_offset=offset;
+ offset=dissect_dcerpc_uint32(tvb, offset, pinfo, NULL, drep, -1, &len);
+ di->array_max_count_offset=offset-4;
+ di->conformant_run=1;
+ di->conformant_eaten=offset-old_offset;
+ return offset;
+ }
+
+ ALIGN_TO_2_BYTES;
+
+ s = tvb_fake_unicode(tvb, offset, len, TRUE);
+ 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[0] & 0x10);
+ }
+ }
+
+ offset+=2*len;
+ return offset;
}
+
static int
drsuapi_dissect_a_string(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_)
{
return offset;
}
-static int
-drsuapi_dissect_DsReplicaSyncRequest1Info_nc_dn(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
-{
- guint32 param=0;
- offset=drsuapi_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_drsuapi_DsReplicaSyncRequest1Info_nc_dn, param);
- return offset;
-}
-
-static int
-ucarray_drsuapi_dissect_DsReplicaSyncRequest1Info_nc_dn(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
-{
- offset=dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep, drsuapi_dissect_DsReplicaSyncRequest1Info_nc_dn);
- return offset;
-}
-
int
drsuapi_dissect_DsReplicaSyncRequest1Info(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_)
proto_register_drsuapi(void)
{
static hf_register_info hf[] = {
+ { &hf_drsuapi_DsReplicaSyncRequest1Info_nc_dn,
+ { "nc_dn", "drsuapi.DsReplicaSyncRequest1Info.nc_dn", FT_STRING, BASE_DEC,
+ NULL, 0,
+ "", HFILL }},
NULL, 0,
"", HFILL }},
- { &hf_drsuapi_DsReplicaSyncRequest1Info_nc_dn,
- { "nc_dn", "drsuapi.DsReplicaSyncRequest1Info.nc_dn", FT_UINT16, BASE_DEC,
- NULL, 0,
- "", HFILL }},
-
{ &hf_drsuapi_DsReplicaSyncOptions_DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_OPERATION,
{ "DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_OPERATION", "drsuapi.DsReplicaSyncOptions.DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_OPERATION", FT_BOOLEAN, 32,
TFS(&DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_OPERATION_tfs), 0x00000001,