diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
commit | e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch) | |
tree | 68cb5ef9081156392f1dd62a00c6ccc1451b93df /epan/dissectors/pidl/frsrpc/frsrpc.cnf | |
parent | Initial commit. (diff) | |
download | wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip |
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/pidl/frsrpc/frsrpc.cnf')
-rw-r--r-- | epan/dissectors/pidl/frsrpc/frsrpc.cnf | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/epan/dissectors/pidl/frsrpc/frsrpc.cnf b/epan/dissectors/pidl/frsrpc/frsrpc.cnf new file mode 100644 index 00000000..a0116f30 --- /dev/null +++ b/epan/dissectors/pidl/frsrpc/frsrpc.cnf @@ -0,0 +1,115 @@ +NOEMIT CommPktChunkCtr +NOEMIT CommPktChangeOrderCommand.file_name + +ETT_FIELD ett_ChunkCtr +HF_FIELD hf_frsrpc_CommPktChangeOrderCommand_file_name "File Name" "frsrpc.CommPktChangeOrderCommand.file_name" FT_STRING BASE_NONE NULL 0 "" "" "" +HF_FIELD hf_CommPktChunk "Chunk" "frsrpc.chunk.ctr.chunk" FT_NONE BASE_NONE NULL 0 "" "" "" + +MANUAL frsrpc_dissect_struct_frsrpc_CommPktChunkCtr +MANUAL frsrpc_dissect_element_CommPktChangeOrderCommand_file_name +MANUAL frsrpc_dissect_enum_CommPktCommand +MANUAL frsrpc_dissect_struct_CommPktChunk + +CODE START +static int +frsrpc_dissect_element_CommPktChangeOrderCommand_file_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di, guint8 *drep _U_) +{ + int conformant = di->conformant_run; + + if (!conformant) { + guint32 soffset = dissect_null_term_wstring(tvb, offset, pinfo, tree, drep, hf_frsrpc_CommPktChangeOrderCommand_file_name, 0); + /* The difference has to be 4 due to the uint16 of the length + null terminator utf16*/ + DISSECTOR_ASSERT(soffset - offset < 261); + offset += 261; + } + + return offset; +} + +int +frsrpc_dissect_struct_CommPktChunk(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di, guint8 *drep _U_, int hf_index _U_, guint32 param _U_) +{ + guint1632 type = 0; + int i = 0; + const char *s = NULL; + proto_item *item = NULL; + proto_tree *tree = NULL; + int old_offset; + + + old_offset = offset; + + if (parent_tree) { + item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE); + tree = proto_item_add_subtree(item, ett_frsrpc_frsrpc_CommPktChunk); + } + + offset = frsrpc_dissect_element_CommPktChunk_type(tvb, offset, pinfo, tree, di, drep, &type); + + offset = frsrpc_dissect_element_CommPktChunk_data(tvb, offset, pinfo, tree, di, drep, &type); + + for (i=0; frsrpc_frsrpc_CommPktChunkType_vals[i].strptr; i++) { + if (frsrpc_frsrpc_CommPktChunkType_vals[i].value == type) { + s = frsrpc_frsrpc_CommPktChunkType_vals[i].strptr; + } + } + if (s != NULL) { + proto_item_append_text(item, ", type = %s", s); + } + proto_item_set_len(item, offset-old_offset); + + + if (di->call_data->flags & DCERPC_IS_NDR64) { + ALIGN_TO_3_BYTES; + } + + return offset; +} + +int +frsrpc_dissect_enum_CommPktCommand(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_) +{ + guint32 parameter=0; + int i = 0; + const char *s = NULL; + if(param){ + parameter=(guint32)*param; + } + offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_index, ¶meter); + + for (i=0; frsrpc_frsrpc_CommPktCommand_vals[i].strptr != NULL; i++) { + if (frsrpc_frsrpc_CommPktCommand_vals[i].value == parameter) { + s = frsrpc_frsrpc_CommPktCommand_vals[i].strptr; + } + } + if (s!= NULL) + col_append_fstr(pinfo->cinfo, COL_INFO, ",command = %s", + s); + + if(param){ + *param=(guint32)parameter; + } + return offset; +} + + +static int +frsrpc_dissect_struct_frsrpc_CommPktChunkCtr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info* di, guint8 *drep _U_, int hf_index, guint32 param _U_) +{ + guint32 remaining = tvb_reported_length_remaining(tvb, offset); + int align_status = di->no_align; + + if (remaining > 0) { + proto_item *item = proto_tree_add_item(tree, hf_index, tvb, offset, -1, TRUE); + proto_tree *subtree = proto_item_add_subtree(item, ett_ChunkCtr); + di->no_align = 1; + while (remaining > 0) { + offset = frsrpc_dissect_struct_CommPktChunk(tvb, offset, pinfo, subtree, di, drep, hf_CommPktChunk, param); + remaining = tvb_reported_length_remaining(tvb, offset); + } + di->no_align = align_status; + } + return offset; +} + +CODE END |