Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-dcerpc-rs_misc.c
blob844bfac6623ba0fe63c45ff906bd20979c113b3a
1 /* packet-dcerpc-rs_misc.c
3 * Routines for dcerpc RS-MISC
4 * Copyright 2002, Jaime Fournier <Jaime.Fournier@hush.com>
5 * This information is based off the released idl files from opengroup.
6 * ftp://ftp.opengroup.org/pub/dce122/dce/src/security.tar.gz security/idl/rs_misc.idl
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * SPDX-License-Identifier: GPL-2.0-or-later
15 #include "config.h"
18 #include <epan/packet.h>
19 #include "packet-dcerpc.h"
21 void proto_register_rs_misc (void);
22 void proto_reg_handoff_rs_misc (void);
24 static int proto_rs_misc;
25 static int hf_rs_misc_opnum;
26 static int hf_rs_misc_login_get_info_rqst_var;
27 static int hf_rs_misc_login_get_info_rqst_key_size;
28 static int hf_rs_misc_login_get_info_rqst_key_t;
31 static int ett_rs_misc;
34 static e_guid_t uuid_rs_misc = { 0x4c878280, 0x5000, 0x0000, { 0x0d, 0x00, 0x02, 0x87, 0x14, 0x00, 0x00, 0x00 } };
35 static uint16_t ver_rs_misc = 1;
38 static int
39 rs_misc_dissect_login_get_info_rqst (tvbuff_t *tvb, int offset,
40 packet_info *pinfo, proto_tree *tree, dcerpc_info *di, uint8_t *drep)
43 uint32_t key_size;
44 const uint8_t *key_t1 = NULL;
46 offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, di, drep,
47 hf_rs_misc_login_get_info_rqst_var, NULL);
48 offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, di, drep,
49 hf_rs_misc_login_get_info_rqst_key_size, &key_size);
51 if (key_size){ /* Not able to yet decipher the OTHER versions of this call just yet. */
53 proto_tree_add_item_ret_string(tree, hf_rs_misc_login_get_info_rqst_key_t, tvb, offset, key_size, ENC_ASCII|ENC_NA, pinfo->pool, &key_t1);
54 offset += key_size;
56 col_append_fstr(pinfo->cinfo, COL_INFO,
57 "rs_login_get_info Request for: %s ", key_t1);
58 } else {
59 col_append_str(pinfo->cinfo, COL_INFO,
60 "rs_login_get_info Request (other)");
63 return offset;
67 static const dcerpc_sub_dissector rs_misc_dissectors[] = {
68 { 0, "login_get_info", rs_misc_dissect_login_get_info_rqst, NULL},
69 { 1, "wait_until_consistent", NULL, NULL},
70 { 2, "check_consistency", NULL, NULL},
71 { 0, NULL, NULL, NULL }
74 void
75 proto_register_rs_misc (void)
77 static hf_register_info hf[] = {
78 { &hf_rs_misc_opnum,
79 { "Operation", "rs_misc.opnum", FT_UINT16, BASE_DEC,
80 NULL, 0x0, NULL, HFILL }},
81 { &hf_rs_misc_login_get_info_rqst_var,
82 { "Var", "rs_misc.login_get_info_rqst_var", FT_UINT32, BASE_DEC,
83 NULL, 0x0, NULL, HFILL }},
84 { &hf_rs_misc_login_get_info_rqst_key_size,
85 { "Key Size", "rs_misc.login_get_info_rqst_key_size", FT_UINT32, BASE_DEC,
86 NULL, 0x0, NULL, HFILL }},
87 { &hf_rs_misc_login_get_info_rqst_key_t,
88 { "Key", "rs_misc.login_get_info_rqst_key_t", FT_STRING, BASE_NONE,
89 NULL, 0x0, NULL, HFILL }}
92 static int *ett[] = {
93 &ett_rs_misc,
95 proto_rs_misc = proto_register_protocol ("DCE/RPC RS_MISC", "rs_misc", "rs_misc");
96 proto_register_field_array (proto_rs_misc, hf, array_length (hf));
97 proto_register_subtree_array (ett, array_length (ett));
100 void
101 proto_reg_handoff_rs_misc (void)
103 /* Register the protocol as dcerpc */
104 dcerpc_init_uuid (proto_rs_misc, ett_rs_misc, &uuid_rs_misc, ver_rs_misc, rs_misc_dissectors, hf_rs_misc_opnum);
108 * Editor modelines - https://www.wireshark.org/tools/modelines.html
110 * Local variables:
111 * c-basic-offset: 8
112 * tab-width: 8
113 * indent-tabs-mode: t
114 * End:
116 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
117 * :indentSize=8:tabSize=8:noTabs=false: