2 * Routines for yppasswd dissection
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 #include "packet-rpc.h"
26 #include "packet-yppasswd.h"
28 void proto_register_yppasswd(void);
29 void proto_reg_handoff_yppasswd(void);
31 static int proto_yppasswd = -1;
32 static int hf_yppasswd_procedure_v1 = -1;
33 static int hf_yppasswd_status = -1;
34 static int hf_yppasswd_oldpass = -1;
35 static int hf_yppasswd_newpw = -1;
36 static int hf_yppasswd_newpw_name = -1;
37 static int hf_yppasswd_newpw_passwd = -1;
38 static int hf_yppasswd_newpw_uid = -1;
39 static int hf_yppasswd_newpw_gid = -1;
40 static int hf_yppasswd_newpw_gecos = -1;
41 static int hf_yppasswd_newpw_dir = -1;
42 static int hf_yppasswd_newpw_shell = -1;
44 static gint ett_yppasswd = -1;
45 static gint ett_yppasswd_newpw = -1;
48 dissect_yppasswd_call(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
50 proto_item *lock_item = NULL;
51 proto_tree *lock_tree = NULL;
54 offset = dissect_rpc_string(tvb, tree, hf_yppasswd_oldpass,
57 lock_item = proto_tree_add_item(tree, hf_yppasswd_newpw, tvb,
60 lock_tree = proto_item_add_subtree(lock_item, ett_yppasswd_newpw);
62 offset = dissect_rpc_string(tvb, lock_tree,
63 hf_yppasswd_newpw_name, offset, NULL);
64 offset = dissect_rpc_string(tvb, lock_tree,
65 hf_yppasswd_newpw_passwd, offset, NULL);
66 offset = dissect_rpc_uint32(tvb, lock_tree,
67 hf_yppasswd_newpw_uid, offset);
68 offset = dissect_rpc_uint32(tvb, lock_tree,
69 hf_yppasswd_newpw_gid, offset);
70 offset = dissect_rpc_string(tvb, lock_tree,
71 hf_yppasswd_newpw_gecos, offset, NULL);
72 offset = dissect_rpc_string(tvb, lock_tree,
73 hf_yppasswd_newpw_dir, offset, NULL);
74 offset = dissect_rpc_string(tvb, lock_tree,
75 hf_yppasswd_newpw_shell, offset, NULL);
81 dissect_yppasswd_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
83 return dissect_rpc_uint32(tvb, tree, hf_yppasswd_status, 0);
86 /* proc number, "proc name", dissect_request, dissect_reply */
87 static const vsff yppasswd1_proc[] = {
88 { YPPASSWDPROC_NULL, "NULL",
89 dissect_rpc_void, dissect_rpc_void },
90 { YPPASSWDPROC_UPDATE, "UPDATE",
91 dissect_yppasswd_call, dissect_yppasswd_reply },
92 { 0, NULL, NULL, NULL }
94 static const value_string yppasswd1_proc_vals[] = {
95 { YPPASSWDPROC_NULL, "NULL" },
96 { YPPASSWDPROC_UPDATE, "UPDATE" },
101 proto_register_yppasswd(void)
103 static hf_register_info hf[] = {
104 { &hf_yppasswd_procedure_v1, {
105 "V1 Procedure", "yppasswd.procedure_v1", FT_UINT32, BASE_DEC,
106 VALS(yppasswd1_proc_vals), 0, NULL, HFILL }},
107 { &hf_yppasswd_status, {
108 "status", "yppasswd.status", FT_UINT32, BASE_DEC,
109 NULL, 0, "YPPasswd update status", HFILL }},
111 { &hf_yppasswd_oldpass, {
112 "oldpass", "yppasswd.oldpass", FT_STRING, BASE_NONE,
113 NULL, 0, "Old encrypted password", HFILL }},
115 { &hf_yppasswd_newpw, {
116 "newpw", "yppasswd.newpw", FT_NONE, BASE_NONE,
117 NULL, 0, "New passwd entry", HFILL }},
119 { &hf_yppasswd_newpw_name, {
120 "name", "yppasswd.newpw.name", FT_STRING, BASE_NONE,
121 NULL, 0, "Username", HFILL }},
123 { &hf_yppasswd_newpw_passwd, {
124 "passwd", "yppasswd.newpw.passwd", FT_STRING, BASE_NONE,
125 NULL, 0, "Encrypted passwd", HFILL }},
127 { &hf_yppasswd_newpw_uid, {
128 "uid", "yppasswd.newpw.uid", FT_UINT32, BASE_DEC,
129 NULL, 0, "UserID", HFILL }},
131 { &hf_yppasswd_newpw_gid, {
132 "gid", "yppasswd.newpw.gid", FT_UINT32, BASE_DEC,
133 NULL, 0, "GroupID", HFILL }},
135 { &hf_yppasswd_newpw_gecos, {
136 "gecos", "yppasswd.newpw.gecos", FT_STRING, BASE_NONE,
137 NULL, 0, "In real life name", HFILL }},
139 { &hf_yppasswd_newpw_dir, {
140 "dir", "yppasswd.newpw.dir", FT_STRING, BASE_NONE,
141 NULL, 0, "Home Directory", HFILL }},
143 { &hf_yppasswd_newpw_shell, {
144 "shell", "yppasswd.newpw.shell", FT_STRING, BASE_NONE,
145 NULL, 0, "Default shell", HFILL }},
149 static gint *ett[] = {
154 proto_yppasswd = proto_register_protocol("Yellow Pages Passwd",
155 "YPPASSWD", "yppasswd");
156 proto_register_field_array(proto_yppasswd, hf, array_length(hf));
157 proto_register_subtree_array(ett, array_length(ett));
161 proto_reg_handoff_yppasswd(void)
163 /* Register the protocol as RPC */
164 rpc_init_prog(proto_yppasswd, YPPASSWD_PROGRAM, ett_yppasswd);
165 /* Register the procedure tables */
166 rpc_init_proc_table(proto_yppasswd, YPPASSWD_PROGRAM, 1, yppasswd1_proc, hf_yppasswd_procedure_v1);
170 * Editor modelines - http://www.wireshark.org/tools/modelines.html
175 * indent-tabs-mode: t
178 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
179 * :indentSize=8:tabSize=8:noTabs=false: