Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-kadm5.c
blobe6ccdf6a3a24253fcf56ef3356179c8a02413007
1 /* packet-kadm5.c
2 * Routines for kadm5 dissection
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
12 * The kadm5 RPC protocol is used to administer Kerberos principals
13 * and policies. It is not officially documented anywhere. The
14 * information for this dissector came from the MIT kadmin source.
17 #include "config.h"
19 #include "packet-rpc.h"
21 void proto_register_kadm5(void);
22 void proto_reg_handoff_kadm5(void);
24 #define KADM5_PROGRAM 2112
25 #define KADM5PROC_NULL 0
26 #define KADM5PROC_CREATE_PRINCIPAL 1
27 #define KADM5PROC_DELETE_PRINCIPAL 2
28 #define KADM5PROC_MODIFY_PRINCIPAL 3
29 #define KADM5PROC_RENAME_PRINCIPAL 4
30 #define KADM5PROC_GET_PRINCIPAL 5
31 #define KADM5PROC_CHPASS_PRINCIPAL 6
32 #define KADM5PROC_CHRAND_PRINCIPAL 7
33 #define KADM5PROC_CREATE_POLICY 8
34 #define KADM5PROC_DELETE_POLICY 9
35 #define KADM5PROC_MODIFY_POLICY 10
36 #define KADM5PROC_GET_POLICY 11
37 #define KADM5PROC_GET_PRIVS 12
38 #define KADM5PROC_INIT 13
39 #define KADM5PROC_GET_PRINCS 14
40 #define KADM5PROC_GET_POLS 15
41 #define KADM5PROC_SETKEY_PRINCIPAL 16
42 #define KADM5PROC_SETV4KEY_PRINCIPAL 17
43 #define KADM5PROC_CREATE_PRINCIPAL3 18
44 #define KADM5PROC_CHPASS_PRINCIPAL3 19
45 #define KADM5PROC_CHRAND_PRINCIPAL3 20
46 #define KADM5PROC_SETKEY_PRINCIPAL3 21
48 static int proto_kadm5;
49 static int hf_kadm5_procedure_v2;
50 static int ett_kadm5;
52 /* proc number, "proc name", dissect_request, dissect_reply */
53 static const vsff kadm5_v2_proc[] = {
54 { KADM5PROC_NULL, "NULL", dissect_rpc_void, dissect_rpc_void },
55 { KADM5PROC_CREATE_PRINCIPAL, "CREATE_PRINCIPAL", dissect_rpc_unknown, dissect_rpc_unknown },
56 { KADM5PROC_DELETE_PRINCIPAL, "DELETE_PRINCIPAL", dissect_rpc_unknown, dissect_rpc_unknown },
57 { KADM5PROC_MODIFY_PRINCIPAL, "MODIFY_PRINCIPAL", dissect_rpc_unknown, dissect_rpc_unknown },
58 { KADM5PROC_RENAME_PRINCIPAL, "RENAME_PRINCIPAL", dissect_rpc_unknown, dissect_rpc_unknown },
59 { KADM5PROC_GET_PRINCIPAL, "GET_PRINCIPAL", dissect_rpc_unknown, dissect_rpc_unknown },
60 { KADM5PROC_CHPASS_PRINCIPAL, "CHPASS_PRINCIPAL", dissect_rpc_unknown, dissect_rpc_unknown },
61 { KADM5PROC_CHRAND_PRINCIPAL, "CHRAND_PRINCIPAL", dissect_rpc_unknown, dissect_rpc_unknown },
62 { KADM5PROC_CREATE_POLICY, "CREATE_POLICY", dissect_rpc_unknown, dissect_rpc_unknown },
63 { KADM5PROC_DELETE_POLICY, "DELETE_POLICY", dissect_rpc_unknown, dissect_rpc_unknown },
64 { KADM5PROC_MODIFY_POLICY, "MODIFY_POLICY", dissect_rpc_unknown, dissect_rpc_unknown },
65 { KADM5PROC_GET_POLICY, "GET_POLICY", dissect_rpc_unknown, dissect_rpc_unknown },
66 { KADM5PROC_GET_PRIVS, "GET_PRIVS", dissect_rpc_unknown, dissect_rpc_unknown },
67 { KADM5PROC_INIT, "INIT", dissect_rpc_unknown, dissect_rpc_unknown },
68 { KADM5PROC_GET_PRINCS, "GET_PRINCS", dissect_rpc_unknown, dissect_rpc_unknown },
69 { KADM5PROC_GET_POLS, "GET_POLS", dissect_rpc_unknown, dissect_rpc_unknown },
70 { KADM5PROC_SETKEY_PRINCIPAL, "SETKEY_PRINCIPAL", dissect_rpc_unknown, dissect_rpc_unknown },
71 { KADM5PROC_SETV4KEY_PRINCIPAL, "SETV4KEY_PRINCIPAL", dissect_rpc_unknown, dissect_rpc_unknown },
72 { KADM5PROC_CREATE_PRINCIPAL3, "CREATE_PRINCIPAL3", dissect_rpc_unknown, dissect_rpc_unknown },
73 { KADM5PROC_CHPASS_PRINCIPAL3, "CHPASS_PRINCIPAL3", dissect_rpc_unknown, dissect_rpc_unknown },
74 { KADM5PROC_CHRAND_PRINCIPAL3, "CHRAND_PRINCIPAL3", dissect_rpc_unknown, dissect_rpc_unknown },
75 { KADM5PROC_SETKEY_PRINCIPAL3, "SETKEY_PRINCIPAL3", dissect_rpc_unknown, dissect_rpc_unknown },
76 { 0, NULL, NULL, NULL }
79 static const value_string kadm5_v2_proc_vals[] = {
80 { KADM5PROC_NULL, "NULL" },
81 { KADM5PROC_CREATE_PRINCIPAL, "CREATE_PRINCIPAL" },
82 { KADM5PROC_DELETE_PRINCIPAL, "DELETE_PRINCIPAL" },
83 { KADM5PROC_MODIFY_PRINCIPAL, "MODIFY_PRINCIPAL" },
84 { KADM5PROC_RENAME_PRINCIPAL, "RENAME_PRINCIPAL" },
85 { KADM5PROC_GET_PRINCIPAL, "GET_PRINCIPAL" },
86 { KADM5PROC_CHPASS_PRINCIPAL, "CHPASS_PRINCIPAL" },
87 { KADM5PROC_CHRAND_PRINCIPAL, "CHRAND_PRINCIPAL" },
88 { KADM5PROC_CREATE_POLICY, "CREATE_POLICY" },
89 { KADM5PROC_DELETE_POLICY, "DELETE_POLICY" },
90 { KADM5PROC_MODIFY_POLICY, "MODIFY_POLICY" },
91 { KADM5PROC_GET_POLICY, "GET_POLICY" },
92 { KADM5PROC_GET_PRIVS, "GET_PRIVS" },
93 { KADM5PROC_INIT, "INIT" },
94 { KADM5PROC_GET_PRINCS, "GET_PRINCS" },
95 { KADM5PROC_GET_POLS, "GET_POLS" },
96 { KADM5PROC_SETKEY_PRINCIPAL, "SETKEY_PRINCIPAL" },
97 { KADM5PROC_SETV4KEY_PRINCIPAL, "SETV4KEY_PRINCIPAL" },
98 { KADM5PROC_CREATE_PRINCIPAL3, "CREATE_PRINCIPAL3" },
99 { KADM5PROC_CHPASS_PRINCIPAL3, "CHPASS_PRINCIPAL3" },
100 { KADM5PROC_CHRAND_PRINCIPAL3, "CHRAND_PRINCIPAL3" },
101 { KADM5PROC_SETKEY_PRINCIPAL3, "SETKEY_PRINCIPAL3" },
102 { 0, NULL }
105 static const rpc_prog_vers_info kadm5_vers_info[] = {
106 { 2, kadm5_v2_proc, &hf_kadm5_procedure_v2 },
109 void
110 proto_register_kadm5(void)
112 static hf_register_info hf[] = {
113 { &hf_kadm5_procedure_v2, {
114 "V2 Procedure", "kadm5.procedure_v2", FT_UINT32, BASE_DEC,
115 VALS(kadm5_v2_proc_vals), 0, NULL, HFILL }},
118 static int *ett[] = {
119 &ett_kadm5,
122 proto_kadm5 = proto_register_protocol("Kerberos Administration",
123 "KADM5", "kadm5");
124 proto_register_field_array(proto_kadm5, hf, array_length(hf));
125 proto_register_subtree_array(ett, array_length(ett));
128 void
129 proto_reg_handoff_kadm5(void)
131 /* Register the protocol as RPC */
132 rpc_init_prog(proto_kadm5, KADM5_PROGRAM, ett_kadm5,
133 G_N_ELEMENTS(kadm5_vers_info), kadm5_vers_info);
137 * Editor modelines - https://www.wireshark.org/tools/modelines.html
139 * Local variables:
140 * c-basic-offset: 8
141 * tab-width: 8
142 * indent-tabs-mode: t
143 * End:
145 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
146 * :indentSize=8:tabSize=8:noTabs=false: