int PIDL_dissect_uint8 (tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hfindex, guint32 param _U_) { dcerpc_info *di; guint8 val; di=pinfo->private_data; if(di->conformant_run){ /* just a run to handle conformant arrays, no scalars to dissect */ return offset; } /* no alignment needed */ offset=dissect_dcerpc_uint8 (tvb, offset, pinfo, tree, drep, hfindex, &val); if(param&PIDL_SET_COL_INFO){ header_field_info *hf_info; char *valstr; hf_info=proto_registrar_get_nth(hfindex); valstr=ep_alloc(64); valstr[0]=0; switch(hf_info->display){ case BASE_DEC: if(hf_info->strings){ g_snprintf(valstr, 64, "%s(%d)",val_to_str(val, hf_info->strings, "Unknown:%u"), val); } else { g_snprintf(valstr, 64, "%d", val); } break; case BASE_HEX: if(hf_info->strings){ g_snprintf(valstr, 64, "%s(0x%02x)",val_to_str(val, hf_info->strings, "Unknown:%u"), val); } else { g_snprintf(valstr, 64, "0x%02x", val); } break; default: REPORT_DISSECTOR_BUG("Invalid hf->display value"); } if (check_col(pinfo->cinfo, COL_INFO)) { col_append_fstr(pinfo->cinfo, COL_INFO," %s:%s", hf_info->name, valstr); } } return offset; }
int dissect_ndr_uint8 (tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hfindex, guint8 *pdata) { dcerpc_info *di; di=pinfo->private_data; if(di->conformant_run){ /* just a run to handle conformant arrays, no scalars to dissect */ return offset; } /* no alignment needed */ return dissect_dcerpc_uint8 (tvb, offset, pinfo, tree, drep, hfindex, pdata); }
int dissect_ndr_uint8(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep, int hfindex, guint8 *pdata) { /* Some callers expect us to initialize pdata, even in error conditions, so * do it right away in case we forget later */ if (pdata) *pdata = 0; if (di->conformant_run) { /* just a run to handle conformant arrays, no scalars to dissect */ return offset; } /* no alignment needed */ return dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep, hfindex, pdata); }