HACK: pinfo->private_data points to smb_info again
[wireshark-wip.git] / epan / dissectors / packet-starteam.c
bloba6251bb083bae7a3845f231a9118f1a2411f649d
1 /* packet-starteam.c
2 * Routines for Borland StarTeam packet dissection
4 * metatech <metatech[AT]flashmail.com>
6 * $Id$
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 /* StarTeam in a nutshell
29 * StarTeam is a Software Change & Configuration Management Tool (like CVS)
32 #include "config.h"
34 #include <glib.h>
35 #include <epan/packet.h>
36 #include <epan/conversation.h>
37 #include <epan/prefs.h>
38 #include "packet-tcp.h"
40 static int proto_starteam = -1;
42 static int hf_starteam_mdh_session_tag = -1;
43 static int hf_starteam_mdh_ctimestamp = -1;
44 static int hf_starteam_mdh_flags = -1;
45 static int hf_starteam_mdh_keyid = -1;
46 static int hf_starteam_mdh_reserved = -1;
47 static int hf_starteam_ph_signature = -1;
48 static int hf_starteam_ph_packet_size = -1;
49 static int hf_starteam_ph_data_size = -1;
50 static int hf_starteam_ph_data_flags = -1;
51 static int hf_starteam_id_revision_level = -1;
52 static int hf_starteam_id_client = -1;
53 static int hf_starteam_id_connect = -1;
54 static int hf_starteam_id_component = -1;
55 static int hf_starteam_id_command = -1;
56 static int hf_starteam_id_command_time = -1;
57 static int hf_starteam_id_command_userid = -1;
58 static int hf_starteam_data_data = -1;
60 static gint ett_starteam = -1;
61 static gint ett_starteam_mdh = -1;
62 static gint ett_starteam_ph = -1;
63 static gint ett_starteam_id = -1;
64 static gint ett_starteam_data = -1;
66 static dissector_handle_t starteam_tcp_handle;
68 static gboolean starteam_desegment = TRUE;
70 #define STARTEAM_MAGIC 0x416C616E /* "Alan" */
72 #define STARTEAM_SRVR_CMD_GET_SESSION_TAG 1
73 #define STARTEAM_SRVR_CMD_GET_REQUIRED_ENCRYPTION_LEVEL 2
74 #define STARTEAM_SRVR_CMD_GET_SERVER_PARAMS 3
75 #define STARTEAM_SRVR_CMD_SERVER_CONNECT 4
76 #define STARTEAM_SRVR_CMD_SERVER_RECONNECT 5
77 #define STARTEAM_SRVR_CMD_BEGIN_LOGIN 10
78 #define STARTEAM_SRVR_CMD_KEY_EXCHANGE_PHASE0 11
79 #define STARTEAM_SRVR_CMD_KEY_EXCHANGE_PHASE12 12
80 #define STARTEAM_SRVR_CMD_KEY_EXCHANGE_PHASE3 13
81 #define STARTEAM_SRVR_CMD_SERVER_LOGIN 14
82 #define STARTEAM_SRVR_CMD_GET_PROJECT_LIST 1001
83 #define STARTEAM_SRVR_CMD_GET_PROJECT_VIEWS 1002
84 #define STARTEAM_SRVR_CMD_PROJECT_LOGIN 1011
85 #define STARTEAM_SRVR_CMD_PROJECT_LOGOUT 1013
86 #define STARTEAM_PROJ_CMD_LIST_SET_READ 1014
87 #define STARTEAM_PROJ_CMD_LIST_ADD_ATTACHMENT 1015
88 #define STARTEAM_PROJ_CMD_LIST_GET_ATTACHMENT 1016
89 #define STARTEAM_PROJ_CMD_LIST_REMOVE_ATTACHMENT 1017
90 #define STARTEAM_PROJ_CMD_MAIL_LIST_ITEMS 1018
91 #define STARTEAM_PROJ_CMD_LIST_ANY_NEWITEMS 1020
92 #define STARTEAM_PROJ_CMD_LIST_GET_NEWITEMS 1021
93 #define STARTEAM_SRVR_CMD_RELEASE_CLIENT 1021 /* XXX: ?? */
94 #define STARTEAM_SRVR_CMD_UPDATE_SERVER_INFO 1022
95 #define STARTEAM_SRVR_CMD_GET_USAGE_DATA 1023
96 #define STARTEAM_SRVR_CMD_GET_LICENSE_INFO 1024
97 #define STARTEAM_PROJ_CMD_FILTER_ADD 1030
98 #define STARTEAM_PROJ_CMD_FILTER_MODIFY 1031
99 #define STARTEAM_PROJ_CMD_FILTER_GET 1032
100 #define STARTEAM_PROJ_CMD_FILTER_GET_LIST 1033
101 #define STARTEAM_PROJ_CMD_FILTER_DELETE 1034
102 #define STARTEAM_PROJ_CMD_QUERY_ADD 1035
103 #define STARTEAM_PROJ_CMD_QUERY_MODIFY 1036
104 #define STARTEAM_PROJ_CMD_QUERY_GET 1037
105 #define STARTEAM_PROJ_CMD_QUERY_GET_LIST 1038
106 #define STARTEAM_PROJ_CMD_QUERY_DELETE 1039
107 #define STARTEAM_PROJ_GET_FILTER_CLASS_ID 1040
108 #define STARTEAM_PROJ_GET_QUERY_CLASS_ID 1041
109 #define STARTEAM_SRVR_CMD_PROJECT_CREATE 1051
110 #define STARTEAM_SRVR_CMD_PROJECT_OPEN 1052
111 #define STARTEAM_SRVR_CMD_PROJECT_CLOSE 1053
112 #define STARTEAM_PROJ_CMD_CATALOG_LOADALL 1151
113 #define STARTEAM_PROJ_CMD_CATALOG_LOADSET 1152
114 #define STARTEAM_PROJ_CMD_CATALOG_LOADREGISTEREDCLASSES 1154
115 #define STARTEAM_PROJ_CMD_REFRESH_CLASS_INFO 1160
116 #define STARTEAM_PROJ_CMD_ADD_CUSTOM_FIELD_CLASS_INFO 1161
117 #define STARTEAM_PROJ_CMD_MODIFY_FIELD_CLASS_INFO 1162
118 #define STARTEAM_PROJ_CMD_ADD_CUSTOM_FIELD_CLASS_INFO_EX 1163
119 #define STARTEAM_PROJ_CMD_GET_FOLDER_ITEMS 2001
120 #define STARTEAM_SRVR_CMD_GET_USERS_AND_GROUPS 2001 /* XXX: ?? */
121 #define STARTEAM_PROJ_CMD_REFRESH_ITEMS 2002
122 #define STARTEAM_PROJ_CMD_GET_ITEM 2003
123 #define STARTEAM_SRVR_CMD_GET_EMAIL_USERS 2003 /* XXX: ?? */
124 #define STARTEAM_PROJ_CMD_UPDATE_ITEM 2004
125 #define STARTEAM_PROJ_CMD_DELETE_ITEM 2005
126 #define STARTEAM_PROJ_CMD_SET_ITEM_LOCK 2006
127 #define STARTEAM_PROJ_CMD_DELETE_TREE_ITEM 2007
128 #define STARTEAM_PROJ_CMD_GET_ITEM_HISTORY 2010
129 #define STARTEAM_SRVR_CMD_GET_USER_PERSONAL_INFO 2011
130 #define STARTEAM_SRVR_CMD_SET_USER_PERSONAL_INFO 2012
131 #define STARTEAM_SRVR_CMD_SET_USER_PASSWORD 2013
132 #define STARTEAM_PROJ_CMD_MOVE_ITEMS 2020
133 #define STARTEAM_PROJ_CMD_MOVE_TREE_ITEMS 2021
134 #define STARTEAM_SRVR_CMD_GET_GROUP_INFO 2021 /* XXX: ?? */
135 #define STARTEAM_PROJ_CMD_SHARE_ITEMS 2022
136 #define STARTEAM_SRVR_CMD_ADD_EDIT_GROUP_INFO 2022 /* XXX: ?? */
137 #define STARTEAM_PROJ_CMD_SHARE_TREE_ITEMS 2023
138 #define STARTEAM_SRVR_CMD_DROP_GROUP 2023 /* XXX: ?? */
139 #define STARTEAM_SRVR_CMD_GET_USER_INFO 2024
140 #define STARTEAM_SRVR_CMD_ADD_EDIT_USER_INFO 2025
141 #define STARTEAM_SRVR_CMD_DROP_USER 2026
142 #define STARTEAM_SRVR_CMD_GET_MIN_PASSWORD_LENGTH 2027
143 #define STARTEAM_SRVR_CMD_USER_ADMIN_OPERATION 2028
144 #define STARTEAM_SRVR_CMD_ACCESS_CHECK 2029
145 #define STARTEAM_PROJ_CMD_GET_COMMON_ANCESTOR_ITEM 2030
146 #define STARTEAM_SRVR_CMD_ACCESS_TEST 2030 /* XXX: ?? */
147 #define STARTEAM_PROJ_CMD_UPDATE_REVISION_COMMENT 2031
148 #define STARTEAM_SRVR_CMD_GET_MAIN_LOG_LAST64K 2031 /* XXX: ?? */
149 #define STARTEAM_SRVR_CMD_GET_SERVER_CONFIG 2032
150 #define STARTEAM_SRVR_CMD_SET_SERVER_CONFIG 2033
151 #define STARTEAM_SRVR_CMD_GET_SERVER_ACL 2034
152 #define STARTEAM_SRVR_CMD_DROP_SERVER_ACL 2035
153 #define STARTEAM_SRVR_CMD_SET_SERVER_ACL 2036
154 #define STARTEAM_SRVR_CMD_GET_SYSTEM_POLICY 2037
155 #define STARTEAM_SRVR_CMD_SET_SYSTEM_POLICY 2038
156 #define STARTEAM_SRVR_CMD_GET_SECURITY_LOG 2039
157 #define STARTEAM_SRVR_CMD_GET_SERVER_COMMAND_STATS 2040
158 #define STARTEAM_SRVR_CMD_SET_SERVER_COMMAND_MODE 2041
159 #define STARTEAM_SRVR_CMD_SHUTDOWN 2042
160 #define STARTEAM_SRVR_CMD_RESTART 2043
161 #define STARTEAM_SRVR_CMD_GET_SERVER_COMMAND_MODE 2045
162 #define STARTEAM_SRVR_CMD_GET_LOG 2046
163 #define STARTEAM_SRVR_CMD_GET_COMPONENT_LIST 2050
164 #define STARTEAM_SRVR_CMD_GET_GROUP_MEMBERS 2060
165 #define STARTEAM_PROJ_CMD_GET_ITEMS_VERSIONS 5001
166 #define STARTEAM_SRVR_CMD_VALIDATE_VSS_INI_PATH 9034
167 #define STARTEAM_SRVR_CMD_VALIDATE_PVCS_CFG_PATH 9035
168 #define STARTEAM_SRVR_CMD_GET_VSS_PROJECT_TREE 9036
169 #define STARTEAM_SRVR_CMD_GET_ALL_PVCS_ARCHIVES 9037
170 #define STARTEAM_SRVR_CMD_INITIALIZE_FOREIGN_ACCESS 9038
171 #define STARTEAM_SRVR_CMD_SET_FOREIGN_PROJECT_PW 9039
172 #define STARTEAM_PROJ_CMD_PING 10001
173 #define STARTEAM_PROJ_CMD_SET_LOCALE 10005
174 #define STARTEAM_PROJ_CMD_GET_CONTAINER_ACL 10011
175 #define STARTEAM_PROJ_CMD_SET_CONTAINER_ACL 10012
176 #define STARTEAM_PROJ_CMD_GET_CONTAINER_LEVEL_ACL 10013
177 #define STARTEAM_PROJ_CMD_SET_CONTAINER_LEVEL_ACL 10014
178 #define STARTEAM_PROJ_CMD_GET_OBJECT_ACL 10015
179 #define STARTEAM_PROJ_CMD_SET_OBJECT_ACL 10016
180 #define STARTEAM_PROJ_CMD_ITEM_ACCESS_CHECK 10017
181 #define STARTEAM_PROJ_CMD_ITEM_ACCESS_TEST 10018
182 #define STARTEAM_PROJ_CMD_GET_OWNER 10019
183 #define STARTEAM_PROJ_CMD_ACQUIRE_OWNERSHIP 10020
184 #define STARTEAM_PROJ_CMD_GET_FOLDERS 10021
185 #define STARTEAM_PROJ_CMD_ADD_FOLDERS 10023
186 #define STARTEAM_PROJ_CMD_DELETE_FOLDER 10024
187 #define STARTEAM_PROJ_CMD_MOVE_FOLDER 10025
188 #define STARTEAM_PROJ_CMD_SHARE_FOLDER 10026
189 #define STARTEAM_PROJ_CMD_CONTAINER_ACCESS_CHECK 10031
190 #define STARTEAM_PROJ_CMD_CONTAINER_ACCESS_TEST 10032
191 #define STARTEAM_PROJ_CMD_GET_OBJECT2_ACL 10035
192 #define STARTEAM_PROJ_CMD_SET_OBJECT2_ACL 10036
193 #define STARTEAM_PROJ_CMD_OBJECT_ACCESS_CHECK 10037
194 #define STARTEAM_PROJ_CMD_OBJECT_ACCESS_TEST 10038
195 #define STARTEAM_PROJ_CMD_GET_OBJECT_OWNER 10039
196 #define STARTEAM_PROJ_CMD_ACQUIRE_OBJECT_OWNERSHIP 10040
197 #define STARTEAM_PROJ_CMD_GET_FOLDER_PROPERTIES 10053
198 #define STARTEAM_PROJ_CMD_SET_FOLDER_PROPERTIES 10054
199 #define STARTEAM_PROJ_CMD_GET_ITEM_PROPERTIES 10060
200 #define STARTEAM_PROJ_CMD_SET_ITEM_PROPERTIES 10061
201 #define STARTEAM_PROJ_CMD_GET_ITEM_REFERENCES 10062
202 #define STARTEAM_PROJ_CMD_GET_ITEM_REFERENCE 10063
203 #define STARTEAM_PROJ_CMD_GET_ITEM_REVISIONS 10065
204 #define STARTEAM_PROJ_CMD_DELETE_PROJECT 10083
205 #define STARTEAM_PROJ_CMD_GET_PROJECT_PROPERTIES 10085
206 #define STARTEAM_PROJ_CMD_SET_PROJECT_PROPERTIES 10086
207 #define STARTEAM_PROJ_CMD_GET_VIEW_INFO 10090
208 #define STARTEAM_PROJ_CMD_ADD_VIEW 10091
209 #define STARTEAM_PROJ_CMD_GET_VIEWS 10092
210 #define STARTEAM_PROJ_CMD_GET_VIEW_PROPERTIES 10093
211 #define STARTEAM_PROJ_CMD_SET_VIEW_PROPERTIES 10094
212 #define STARTEAM_PROJ_CMD_DELETE_VIEW 10095
213 #define STARTEAM_PROJ_CMD_SWITCH_VIEW 10098
214 #define STARTEAM_PROJ_CMD_SWITCH_VIEW_CONFIG 10099
215 #define STARTEAM_PROJ_CMD_GET_FOLDER_PATH 10100
216 #define STARTEAM_FILE_CMD_CHECKOUT 10104
217 #define STARTEAM_FILE_CMD_GET_SYNC_INFO 10111
218 #define STARTEAM_FILE_CMD_DELETE_SYNC_INFO 10112
219 #define STARTEAM_FILE_CMD_GET_PATH_IDS 10117
220 #define STARTEAM_FILE_CMD_SYNC_UPDATE_ALL_INFO 10119
221 #define STARTEAM_FILE_CMD_RESYNC_FILE 10121
222 #define STARTEAM_FILE_CMD_CONVERT_ARCHIVE 10122
223 #define STARTEAM_FILE_CMD_ARCHIVE_CONVERSION 10123
224 #define STARTEAM_FILE_CMD_READ_PVCS_ARCHIVES 10130
225 #define STARTEAM_FILE_CMD_ADD_PVCS_ARCHIVES 10131
226 #define STARTEAM_FILE_CMD_ADD_PVCS_BRANCHES 10132
227 #define STARTEAM_FILE_CMD_FINISH_NEW_PVCS_PROJECT 10133
228 #define STARTEAM_FILE_CMD_GET_NUMBER_VSS_ARCHIVES 10134
229 #define STARTEAM_FILE_CMD_READ_VSS_ARCHIVES 10135
230 #define STARTEAM_FILE_CMD_ADD_VSS_ARCHIVE_TO_FOLDER 10136
231 #define STARTEAM_FILE_CMD_FINISH_NEW_VSS_PROJECT 10137
232 #define STARTEAM_FILE_CMD_REFRESH_FOREIGN_FOLDER 10138
233 #define STARTEAM_FILE_CMD_START_GO_NATIVE 10139
234 #define STARTEAM_FILE_CMD_GET_PROJECT_TYPE 10141
235 #define STARTEAM_FILE_CMD_SET_FOREIGN_PROJECT_PW 10142
236 #define STARTEAM_FILE_CMD_INTERNAL_NESTED_COMMAND 10143
237 #define STARTEAM_PROJ_CMD_LABEL_GET_INFO 10201
238 #define STARTEAM_PROJ_CMD_LABEL_GET_PROPERTIES 10202
239 #define STARTEAM_PROJ_CMD_LABEL_SET_PROPERTIES 10203
240 #define STARTEAM_PROJ_CMD_LABEL_CREATE 10205
241 #define STARTEAM_PROJ_CMD_LABEL_DELETE 10206
242 #define STARTEAM_PROJ_CMD_LABEL_ATTACH 10207
243 #define STARTEAM_PROJ_CMD_LABEL_MOVE 10208
244 #define STARTEAM_PROJ_CMD_LABEL_DETACH 10209
245 #define STARTEAM_PROJ_CMD_LABEL_GET_INFO_EX 10221
246 #define STARTEAM_PROJ_CMD_LABEL_CREATE_EX 10222
247 #define STARTEAM_PROJ_CMD_LABEL_ATTACH_EX 10223
248 #define STARTEAM_PROJ_CMD_LABEL_ATTACH_ITEMS 10224
249 #define STARTEAM_PROJ_CMD_LABEL_DETACH_EX 10225
250 #define STARTEAM_PROJ_CMD_LABEL_DETACH_ITEMS 10226
251 #define STARTEAM_PROJ_CMD_LABEL_GETITEMIDS 10229
252 #define STARTEAM_PROJ_CMD_LINK_GET_INFO 10300
253 #define STARTEAM_PROJ_CMD_LINK_CREATE 10301
254 #define STARTEAM_PROJ_CMD_LINK_DELETE 10302
255 #define STARTEAM_PROJ_CMD_LINK_UPDATE_PROPERTIES 10310
256 #define STARTEAM_PROJ_CMD_LINK_UPDATE_PINS 10311
257 #define STARTEAM_PROJ_CMD_PROMOTION_GET 10400
258 #define STARTEAM_PROJ_CMD_PROMOTION_SET 10401
259 #define STARTEAM_TASK_CMD_GET_WORKRECS 10402
260 #define STARTEAM_TASK_CMD_ADD_WORKREC 10403
261 #define STARTEAM_TASK_CMD_UPDATE_WORKREC 10404
262 #define STARTEAM_TASK_CMD_DELETE_WORKREC 10405
263 #define STARTEAM_TASK_CMD_DELETE_TASK_PREDECESSOR 10408
264 #define STARTEAM_TASK_CMD_GET_TASK_DEPENDENCIES 10409
265 #define STARTEAM_TASK_CMD_ADD_TASK_PREDECESSOR 10410
266 #define STARTEAM_TASK_CMD_UPDATE_TASK_PREDECESSOR 10411
267 #define STARTEAM_PROJ_CMD_VIEW_COMPARE_GET_FOLDER_DETAILS 20070
268 #define STARTEAM_PROJ_CMD_VIEW_COMPARE_RELATE_ITEMS 20071
270 #define STARTEAM_TEXT_MDH "Message Data Header"
271 #define STARTEAM_TEXT_PH "Packet Header"
272 #define STARTEAM_TEXT_ID "ID"
273 #define STARTEAM_TEXT_DATA "Data"
275 static const value_string starteam_opcode_vals[] = {
276 { STARTEAM_SRVR_CMD_GET_SESSION_TAG, "SRVR_CMD_GET_SESSION_TAG" },
277 { STARTEAM_SRVR_CMD_GET_REQUIRED_ENCRYPTION_LEVEL, "SRVR_CMD_GET_REQUIRED_ENCRYPTION_LEVEL" },
278 { STARTEAM_SRVR_CMD_GET_SERVER_PARAMS, "SRVR_CMD_GET_SERVER_PARAMS" },
279 { STARTEAM_SRVR_CMD_SERVER_CONNECT, "SRVR_CMD_SERVER_CONNECT" },
280 { STARTEAM_SRVR_CMD_SERVER_RECONNECT, "SRVR_CMD_SERVER_RECONNECT" },
281 { STARTEAM_SRVR_CMD_BEGIN_LOGIN, "SRVR_CMD_BEGIN_LOGIN" },
282 { STARTEAM_SRVR_CMD_KEY_EXCHANGE_PHASE0, "SRVR_CMD_KEY_EXCHANGE_PHASE0" },
283 { STARTEAM_SRVR_CMD_KEY_EXCHANGE_PHASE12, "SRVR_CMD_KEY_EXCHANGE_PHASE12" },
284 { STARTEAM_SRVR_CMD_KEY_EXCHANGE_PHASE3, "SRVR_CMD_KEY_EXCHANGE_PHASE3" },
285 { STARTEAM_SRVR_CMD_SERVER_LOGIN, "SRVR_CMD_SERVER_LOGIN" },
286 { STARTEAM_SRVR_CMD_GET_PROJECT_LIST, "SRVR_CMD_GET_PROJECT_LIST" },
287 { STARTEAM_SRVR_CMD_GET_PROJECT_VIEWS, "SRVR_CMD_GET_PROJECT_VIEWS" },
288 { STARTEAM_SRVR_CMD_PROJECT_LOGIN, "SRVR_CMD_PROJECT_LOGIN" },
289 { STARTEAM_SRVR_CMD_PROJECT_LOGOUT, "SRVR_CMD_PROJECT_LOGOUT" },
290 { STARTEAM_PROJ_CMD_LIST_SET_READ, "PROJ_CMD_LIST_SET_READ" },
291 { STARTEAM_PROJ_CMD_LIST_ADD_ATTACHMENT, "PROJ_CMD_LIST_ADD_ATTACHMENT" },
292 { STARTEAM_PROJ_CMD_LIST_GET_ATTACHMENT, "PROJ_CMD_LIST_GET_ATTACHMENT" },
293 { STARTEAM_PROJ_CMD_LIST_REMOVE_ATTACHMENT, "PROJ_CMD_LIST_REMOVE_ATTACHMENT" },
294 { STARTEAM_PROJ_CMD_MAIL_LIST_ITEMS, "PROJ_CMD_MAIL_LIST_ITEMS" },
295 { STARTEAM_PROJ_CMD_LIST_ANY_NEWITEMS, "PROJ_CMD_LIST_ANY_NEWITEMS" },
296 { STARTEAM_PROJ_CMD_LIST_GET_NEWITEMS, "PROJ_CMD_LIST_GET_NEWITEMS" },
297 { STARTEAM_SRVR_CMD_RELEASE_CLIENT, "SRVR_CMD_RELEASE_CLIENT" },
298 { STARTEAM_SRVR_CMD_UPDATE_SERVER_INFO, "SRVR_CMD_UPDATE_SERVER_INFO" },
299 { STARTEAM_SRVR_CMD_GET_USAGE_DATA, "SRVR_CMD_GET_USAGE_DATA" },
300 { STARTEAM_SRVR_CMD_GET_LICENSE_INFO, "SRVR_CMD_GET_LICENSE_INFO" },
301 { STARTEAM_PROJ_CMD_FILTER_ADD, "PROJ_CMD_FILTER_ADD" },
302 { STARTEAM_PROJ_CMD_FILTER_MODIFY, "PROJ_CMD_FILTER_MODIFY" },
303 { STARTEAM_PROJ_CMD_FILTER_GET, "PROJ_CMD_FILTER_GET" },
304 { STARTEAM_PROJ_CMD_FILTER_GET_LIST, "PROJ_CMD_FILTER_GET_LIST" },
305 { STARTEAM_PROJ_CMD_FILTER_DELETE, "PROJ_CMD_FILTER_DELETE" },
306 { STARTEAM_PROJ_CMD_QUERY_ADD, "PROJ_CMD_QUERY_ADD" },
307 { STARTEAM_PROJ_CMD_QUERY_MODIFY, "PROJ_CMD_QUERY_MODIFY" },
308 { STARTEAM_PROJ_CMD_QUERY_GET, "PROJ_CMD_QUERY_GET" },
309 { STARTEAM_PROJ_CMD_QUERY_GET_LIST, "PROJ_CMD_QUERY_GET_LIST" },
310 { STARTEAM_PROJ_CMD_QUERY_DELETE, "PROJ_CMD_QUERY_DELETE" },
311 { STARTEAM_PROJ_GET_FILTER_CLASS_ID, "PROJ_GET_FILTER_CLASS_ID" },
312 { STARTEAM_PROJ_GET_QUERY_CLASS_ID, "PROJ_GET_QUERY_CLASS_ID" },
313 { STARTEAM_SRVR_CMD_PROJECT_CREATE, "SRVR_CMD_PROJECT_CREATE" },
314 { STARTEAM_SRVR_CMD_PROJECT_OPEN, "SRVR_CMD_PROJECT_OPEN" },
315 { STARTEAM_SRVR_CMD_PROJECT_CLOSE, "SRVR_CMD_PROJECT_CLOSE" },
316 { STARTEAM_PROJ_CMD_CATALOG_LOADALL, "PROJ_CMD_CATALOG_LOADALL" },
317 { STARTEAM_PROJ_CMD_CATALOG_LOADSET, "PROJ_CMD_CATALOG_LOADSET" },
318 { STARTEAM_PROJ_CMD_CATALOG_LOADREGISTEREDCLASSES, "PROJ_CMD_CATALOG_LOADREGISTEREDCLASSES" },
319 { STARTEAM_PROJ_CMD_REFRESH_CLASS_INFO, "PROJ_CMD_REFRESH_CLASS_INFO" },
320 { STARTEAM_PROJ_CMD_ADD_CUSTOM_FIELD_CLASS_INFO, "PROJ_CMD_ADD_CUSTOM_FIELD_CLASS_INFO" },
321 { STARTEAM_PROJ_CMD_MODIFY_FIELD_CLASS_INFO, "PROJ_CMD_MODIFY_FIELD_CLASS_INFO" },
322 { STARTEAM_PROJ_CMD_ADD_CUSTOM_FIELD_CLASS_INFO_EX, "PROJ_CMD_ADD_CUSTOM_FIELD_CLASS_INFO_EX" },
323 { STARTEAM_PROJ_CMD_GET_FOLDER_ITEMS, "PROJ_CMD_GET_FOLDER_ITEMS" },
324 { STARTEAM_SRVR_CMD_GET_USERS_AND_GROUPS, "SRVR_CMD_GET_USERS_AND_GROUPS" },
325 { STARTEAM_PROJ_CMD_REFRESH_ITEMS, "PROJ_CMD_REFRESH_ITEMS" },
326 { STARTEAM_PROJ_CMD_GET_ITEM, "PROJ_CMD_GET_ITEM" },
327 { STARTEAM_SRVR_CMD_GET_EMAIL_USERS, "SRVR_CMD_GET_EMAIL_USERS" },
328 { STARTEAM_PROJ_CMD_UPDATE_ITEM, "PROJ_CMD_UPDATE_ITEM" },
329 { STARTEAM_PROJ_CMD_DELETE_ITEM, "PROJ_CMD_DELETE_ITEM" },
330 { STARTEAM_PROJ_CMD_SET_ITEM_LOCK, "PROJ_CMD_SET_ITEM_LOCK" },
331 { STARTEAM_PROJ_CMD_DELETE_TREE_ITEM, "PROJ_CMD_DELETE_TREE_ITEM" },
332 { STARTEAM_PROJ_CMD_GET_ITEM_HISTORY, "PROJ_CMD_GET_ITEM_HISTORY" },
333 { STARTEAM_SRVR_CMD_GET_USER_PERSONAL_INFO, "SRVR_CMD_GET_USER_PERSONAL_INFO" },
334 { STARTEAM_SRVR_CMD_SET_USER_PERSONAL_INFO, "SRVR_CMD_SET_USER_PERSONAL_INFO" },
335 { STARTEAM_SRVR_CMD_SET_USER_PASSWORD, "SRVR_CMD_SET_USER_PASSWORD" },
336 { STARTEAM_PROJ_CMD_MOVE_ITEMS, "PROJ_CMD_MOVE_ITEMS" },
337 { STARTEAM_PROJ_CMD_MOVE_TREE_ITEMS, "PROJ_CMD_MOVE_TREE_ITEMS" },
338 { STARTEAM_SRVR_CMD_GET_GROUP_INFO, "SRVR_CMD_GET_GROUP_INFO" },
339 { STARTEAM_PROJ_CMD_SHARE_ITEMS, "PROJ_CMD_SHARE_ITEMS" },
340 { STARTEAM_SRVR_CMD_ADD_EDIT_GROUP_INFO, "SRVR_CMD_ADD_EDIT_GROUP_INFO" },
341 { STARTEAM_PROJ_CMD_SHARE_TREE_ITEMS, "PROJ_CMD_SHARE_TREE_ITEMS" },
342 { STARTEAM_SRVR_CMD_DROP_GROUP, "SRVR_CMD_DROP_GROUP" },
343 { STARTEAM_SRVR_CMD_GET_USER_INFO, "SRVR_CMD_GET_USER_INFO" },
344 { STARTEAM_SRVR_CMD_ADD_EDIT_USER_INFO, "SRVR_CMD_ADD_EDIT_USER_INFO" },
345 { STARTEAM_SRVR_CMD_DROP_USER, "SRVR_CMD_DROP_USER" },
346 { STARTEAM_SRVR_CMD_GET_MIN_PASSWORD_LENGTH, "SRVR_CMD_GET_MIN_PASSWORD_LENGTH" },
347 { STARTEAM_SRVR_CMD_USER_ADMIN_OPERATION, "SRVR_CMD_USER_ADMIN_OPERATION" },
348 { STARTEAM_SRVR_CMD_ACCESS_CHECK, "SRVR_CMD_ACCESS_CHECK" },
349 { STARTEAM_PROJ_CMD_GET_COMMON_ANCESTOR_ITEM, "PROJ_CMD_GET_COMMON_ANCESTOR_ITEM" },
350 { STARTEAM_SRVR_CMD_ACCESS_TEST, "SRVR_CMD_ACCESS_TEST" },
351 { STARTEAM_PROJ_CMD_UPDATE_REVISION_COMMENT, "PROJ_CMD_UPDATE_REVISION_COMMENT" },
352 { STARTEAM_SRVR_CMD_GET_MAIN_LOG_LAST64K, "SRVR_CMD_GET_MAIN_LOG_LAST64K" },
353 { STARTEAM_SRVR_CMD_GET_SERVER_CONFIG, "SRVR_CMD_GET_SERVER_CONFIG" },
354 { STARTEAM_SRVR_CMD_SET_SERVER_CONFIG, "SRVR_CMD_SET_SERVER_CONFIG" },
355 { STARTEAM_SRVR_CMD_GET_SERVER_ACL, "SRVR_CMD_GET_SERVER_ACL" },
356 { STARTEAM_SRVR_CMD_DROP_SERVER_ACL, "SRVR_CMD_DROP_SERVER_ACL" },
357 { STARTEAM_SRVR_CMD_SET_SERVER_ACL, "SRVR_CMD_SET_SERVER_ACL" },
358 { STARTEAM_SRVR_CMD_GET_SYSTEM_POLICY, "SRVR_CMD_GET_SYSTEM_POLICY" },
359 { STARTEAM_SRVR_CMD_SET_SYSTEM_POLICY, "SRVR_CMD_SET_SYSTEM_POLICY" },
360 { STARTEAM_SRVR_CMD_GET_SECURITY_LOG, "SRVR_CMD_GET_SECURITY_LOG" },
361 { STARTEAM_SRVR_CMD_GET_SERVER_COMMAND_STATS, "SRVR_CMD_GET_SERVER_COMMAND_STATS" },
362 { STARTEAM_SRVR_CMD_SET_SERVER_COMMAND_MODE, "SRVR_CMD_SET_SERVER_COMMAND_MODE" },
363 { STARTEAM_SRVR_CMD_SHUTDOWN, "SRVR_CMD_SHUTDOWN" },
364 { STARTEAM_SRVR_CMD_RESTART, "SRVR_CMD_RESTART" },
365 { STARTEAM_SRVR_CMD_GET_SERVER_COMMAND_MODE, "SRVR_CMD_GET_SERVER_COMMAND_MODE" },
366 { STARTEAM_SRVR_CMD_GET_LOG, "SRVR_CMD_GET_LOG" },
367 { STARTEAM_SRVR_CMD_GET_COMPONENT_LIST, "SRVR_CMD_GET_COMPONENT_LIST" },
368 { STARTEAM_SRVR_CMD_GET_GROUP_MEMBERS, "SRVR_CMD_GET_GROUP_MEMBERS" },
369 { STARTEAM_PROJ_CMD_GET_ITEMS_VERSIONS, "PROJ_CMD_GET_ITEMS_VERSIONS" },
370 { STARTEAM_SRVR_CMD_VALIDATE_VSS_INI_PATH, "SRVR_CMD_VALIDATE_VSS_INI_PATH" },
371 { STARTEAM_SRVR_CMD_VALIDATE_PVCS_CFG_PATH, "SRVR_CMD_VALIDATE_PVCS_CFG_PATH" },
372 { STARTEAM_SRVR_CMD_GET_VSS_PROJECT_TREE, "SRVR_CMD_GET_VSS_PROJECT_TREE" },
373 { STARTEAM_SRVR_CMD_GET_ALL_PVCS_ARCHIVES, "SRVR_CMD_GET_ALL_PVCS_ARCHIVES" },
374 { STARTEAM_SRVR_CMD_INITIALIZE_FOREIGN_ACCESS, "SRVR_CMD_INITIALIZE_FOREIGN_ACCESS" },
375 { STARTEAM_SRVR_CMD_SET_FOREIGN_PROJECT_PW, "SRVR_CMD_SET_FOREIGN_PROJECT_PW" },
376 { STARTEAM_PROJ_CMD_PING, "PROJ_CMD_PING" },
377 { STARTEAM_PROJ_CMD_SET_LOCALE, "PROJ_CMD_SET_LOCALE" },
378 { STARTEAM_PROJ_CMD_GET_CONTAINER_ACL, "PROJ_CMD_GET_CONTAINER_ACL" },
379 { STARTEAM_PROJ_CMD_SET_CONTAINER_ACL, "PROJ_CMD_SET_CONTAINER_ACL" },
380 { STARTEAM_PROJ_CMD_GET_CONTAINER_LEVEL_ACL, "PROJ_CMD_GET_CONTAINER_LEVEL_ACL" },
381 { STARTEAM_PROJ_CMD_SET_CONTAINER_LEVEL_ACL, "PROJ_CMD_SET_CONTAINER_LEVEL_ACL" },
382 { STARTEAM_PROJ_CMD_GET_OBJECT_ACL, "PROJ_CMD_GET_OBJECT_ACL" },
383 { STARTEAM_PROJ_CMD_SET_OBJECT_ACL, "PROJ_CMD_SET_OBJECT_ACL" },
384 { STARTEAM_PROJ_CMD_ITEM_ACCESS_CHECK, "PROJ_CMD_ITEM_ACCESS_CHECK" },
385 { STARTEAM_PROJ_CMD_ITEM_ACCESS_TEST, "PROJ_CMD_ITEM_ACCESS_TEST" },
386 { STARTEAM_PROJ_CMD_GET_OWNER, "PROJ_CMD_GET_OWNER" },
387 { STARTEAM_PROJ_CMD_ACQUIRE_OWNERSHIP, "PROJ_CMD_ACQUIRE_OWNERSHIP" },
388 { STARTEAM_PROJ_CMD_GET_FOLDERS, "PROJ_CMD_GET_FOLDERS" },
389 { STARTEAM_PROJ_CMD_ADD_FOLDERS, "PROJ_CMD_ADD_FOLDERS" },
390 { STARTEAM_PROJ_CMD_DELETE_FOLDER, "PROJ_CMD_DELETE_FOLDER" },
391 { STARTEAM_PROJ_CMD_MOVE_FOLDER, "PROJ_CMD_MOVE_FOLDER" },
392 { STARTEAM_PROJ_CMD_SHARE_FOLDER, "PROJ_CMD_SHARE_FOLDER" },
393 { STARTEAM_PROJ_CMD_CONTAINER_ACCESS_CHECK, "PROJ_CMD_CONTAINER_ACCESS_CHECK" },
394 { STARTEAM_PROJ_CMD_CONTAINER_ACCESS_TEST, "PROJ_CMD_CONTAINER_ACCESS_TEST" },
395 { STARTEAM_PROJ_CMD_GET_OBJECT2_ACL, "PROJ_CMD_GET_OBJECT2_ACL" },
396 { STARTEAM_PROJ_CMD_SET_OBJECT2_ACL, "PROJ_CMD_SET_OBJECT2_ACL" },
397 { STARTEAM_PROJ_CMD_OBJECT_ACCESS_CHECK, "PROJ_CMD_OBJECT_ACCESS_CHECK" },
398 { STARTEAM_PROJ_CMD_OBJECT_ACCESS_TEST, "PROJ_CMD_OBJECT_ACCESS_TEST" },
399 { STARTEAM_PROJ_CMD_GET_OBJECT_OWNER, "PROJ_CMD_GET_OBJECT_OWNER" },
400 { STARTEAM_PROJ_CMD_ACQUIRE_OBJECT_OWNERSHIP, "PROJ_CMD_ACQUIRE_OBJECT_OWNERSHIP" },
401 { STARTEAM_PROJ_CMD_GET_FOLDER_PROPERTIES, "PROJ_CMD_GET_FOLDER_PROPERTIES" },
402 { STARTEAM_PROJ_CMD_SET_FOLDER_PROPERTIES, "PROJ_CMD_SET_FOLDER_PROPERTIES" },
403 { STARTEAM_PROJ_CMD_GET_ITEM_PROPERTIES, "PROJ_CMD_GET_ITEM_PROPERTIES" },
404 { STARTEAM_PROJ_CMD_SET_ITEM_PROPERTIES, "PROJ_CMD_SET_ITEM_PROPERTIES" },
405 { STARTEAM_PROJ_CMD_GET_ITEM_REFERENCES, "PROJ_CMD_GET_ITEM_REFERENCES" },
406 { STARTEAM_PROJ_CMD_GET_ITEM_REFERENCE, "PROJ_CMD_GET_ITEM_REFERENCE" },
407 { STARTEAM_PROJ_CMD_GET_ITEM_REVISIONS, "PROJ_CMD_GET_ITEM_REVISIONS" },
408 { STARTEAM_PROJ_CMD_DELETE_PROJECT, "PROJ_CMD_DELETE_PROJECT" },
409 { STARTEAM_PROJ_CMD_GET_PROJECT_PROPERTIES, "PROJ_CMD_GET_PROJECT_PROPERTIES" },
410 { STARTEAM_PROJ_CMD_SET_PROJECT_PROPERTIES, "PROJ_CMD_SET_PROJECT_PROPERTIES" },
411 { STARTEAM_PROJ_CMD_GET_VIEW_INFO, "PROJ_CMD_GET_VIEW_INFO" },
412 { STARTEAM_PROJ_CMD_ADD_VIEW, "PROJ_CMD_ADD_VIEW" },
413 { STARTEAM_PROJ_CMD_GET_VIEWS, "PROJ_CMD_GET_VIEWS" },
414 { STARTEAM_PROJ_CMD_GET_VIEW_PROPERTIES, "PROJ_CMD_GET_VIEW_PROPERTIES" },
415 { STARTEAM_PROJ_CMD_SET_VIEW_PROPERTIES, "PROJ_CMD_SET_VIEW_PROPERTIES" },
416 { STARTEAM_PROJ_CMD_DELETE_VIEW, "PROJ_CMD_DELETE_VIEW" },
417 { STARTEAM_PROJ_CMD_SWITCH_VIEW, "PROJ_CMD_SWITCH_VIEW" },
418 { STARTEAM_PROJ_CMD_SWITCH_VIEW_CONFIG, "PROJ_CMD_SWITCH_VIEW_CONFIG" },
419 { STARTEAM_PROJ_CMD_GET_FOLDER_PATH, "PROJ_CMD_GET_FOLDER_PATH" },
420 { STARTEAM_FILE_CMD_CHECKOUT, "FILE_CMD_CHECKOUT" },
421 { STARTEAM_FILE_CMD_GET_SYNC_INFO, "FILE_CMD_GET_SYNC_INFO" },
422 { STARTEAM_FILE_CMD_DELETE_SYNC_INFO, "FILE_CMD_DELETE_SYNC_INFO" },
423 { STARTEAM_FILE_CMD_GET_PATH_IDS, "FILE_CMD_GET_PATH_IDS" },
424 { STARTEAM_FILE_CMD_SYNC_UPDATE_ALL_INFO, "FILE_CMD_SYNC_UPDATE_ALL_INFO" },
425 { STARTEAM_FILE_CMD_RESYNC_FILE, "FILE_CMD_RESYNC_FILE" },
426 { STARTEAM_FILE_CMD_CONVERT_ARCHIVE, "FILE_CMD_CONVERT_ARCHIVE" },
427 { STARTEAM_FILE_CMD_ARCHIVE_CONVERSION, "FILE_CMD_ARCHIVE_CONVERSION" },
428 { STARTEAM_FILE_CMD_READ_PVCS_ARCHIVES, "FILE_CMD_READ_PVCS_ARCHIVES" },
429 { STARTEAM_FILE_CMD_ADD_PVCS_ARCHIVES, "FILE_CMD_ADD_PVCS_ARCHIVES" },
430 { STARTEAM_FILE_CMD_ADD_PVCS_BRANCHES, "FILE_CMD_ADD_PVCS_BRANCHES" },
431 { STARTEAM_FILE_CMD_FINISH_NEW_PVCS_PROJECT, "FILE_CMD_FINISH_NEW_PVCS_PROJECT" },
432 { STARTEAM_FILE_CMD_GET_NUMBER_VSS_ARCHIVES, "FILE_CMD_GET_NUMBER_VSS_ARCHIVES" },
433 { STARTEAM_FILE_CMD_READ_VSS_ARCHIVES, "FILE_CMD_READ_VSS_ARCHIVES" },
434 { STARTEAM_FILE_CMD_ADD_VSS_ARCHIVE_TO_FOLDER, "FILE_CMD_ADD_VSS_ARCHIVE_TO_FOLDER" },
435 { STARTEAM_FILE_CMD_FINISH_NEW_VSS_PROJECT, "FILE_CMD_FINISH_NEW_VSS_PROJECT" },
436 { STARTEAM_FILE_CMD_REFRESH_FOREIGN_FOLDER, "FILE_CMD_REFRESH_FOREIGN_FOLDER" },
437 { STARTEAM_FILE_CMD_START_GO_NATIVE, "FILE_CMD_START_GO_NATIVE" },
438 { STARTEAM_FILE_CMD_GET_PROJECT_TYPE, "FILE_CMD_GET_PROJECT_TYPE" },
439 { STARTEAM_FILE_CMD_SET_FOREIGN_PROJECT_PW, "FILE_CMD_SET_FOREIGN_PROJECT_PW" },
440 { STARTEAM_FILE_CMD_INTERNAL_NESTED_COMMAND, "FILE_CMD_INTERNAL_NESTED_COMMAND" },
441 { STARTEAM_PROJ_CMD_LABEL_GET_INFO, "PROJ_CMD_LABEL_GET_INFO" },
442 { STARTEAM_PROJ_CMD_LABEL_GET_PROPERTIES, "PROJ_CMD_LABEL_GET_PROPERTIES" },
443 { STARTEAM_PROJ_CMD_LABEL_SET_PROPERTIES, "PROJ_CMD_LABEL_SET_PROPERTIES" },
444 { STARTEAM_PROJ_CMD_LABEL_CREATE, "PROJ_CMD_LABEL_CREATE" },
445 { STARTEAM_PROJ_CMD_LABEL_DELETE, "PROJ_CMD_LABEL_DELETE" },
446 { STARTEAM_PROJ_CMD_LABEL_ATTACH, "PROJ_CMD_LABEL_ATTACH" },
447 { STARTEAM_PROJ_CMD_LABEL_MOVE, "PROJ_CMD_LABEL_MOVE" },
448 { STARTEAM_PROJ_CMD_LABEL_DETACH, "PROJ_CMD_LABEL_DETACH" },
449 { STARTEAM_PROJ_CMD_LABEL_GET_INFO_EX, "PROJ_CMD_LABEL_GET_INFO_EX" },
450 { STARTEAM_PROJ_CMD_LABEL_CREATE_EX, "PROJ_CMD_LABEL_CREATE_EX" },
451 { STARTEAM_PROJ_CMD_LABEL_ATTACH_EX, "PROJ_CMD_LABEL_ATTACH_EX" },
452 { STARTEAM_PROJ_CMD_LABEL_ATTACH_ITEMS, "PROJ_CMD_LABEL_ATTACH_ITEMS" },
453 { STARTEAM_PROJ_CMD_LABEL_DETACH_EX, "PROJ_CMD_LABEL_DETACH_EX" },
454 { STARTEAM_PROJ_CMD_LABEL_DETACH_ITEMS, "PROJ_CMD_LABEL_DETACH_ITEMS" },
455 { STARTEAM_PROJ_CMD_LABEL_GETITEMIDS, "PROJ_CMD_LABEL_GETITEMIDS" },
456 { STARTEAM_PROJ_CMD_LINK_GET_INFO, "PROJ_CMD_LINK_GET_INFO" },
457 { STARTEAM_PROJ_CMD_LINK_CREATE, "PROJ_CMD_LINK_CREATE" },
458 { STARTEAM_PROJ_CMD_LINK_DELETE, "PROJ_CMD_LINK_DELETE" },
459 { STARTEAM_PROJ_CMD_LINK_UPDATE_PROPERTIES, "PROJ_CMD_LINK_UPDATE_PROPERTIES" },
460 { STARTEAM_PROJ_CMD_LINK_UPDATE_PINS, "PROJ_CMD_LINK_UPDATE_PINS" },
461 { STARTEAM_PROJ_CMD_PROMOTION_GET, "PROJ_CMD_PROMOTION_GET" },
462 { STARTEAM_PROJ_CMD_PROMOTION_SET, "PROJ_CMD_PROMOTION_SET" },
463 { STARTEAM_TASK_CMD_GET_WORKRECS, "TASK_CMD_GET_WORKRECS" },
464 { STARTEAM_TASK_CMD_ADD_WORKREC, "TASK_CMD_ADD_WORKREC" },
465 { STARTEAM_TASK_CMD_UPDATE_WORKREC, "TASK_CMD_UPDATE_WORKREC" },
466 { STARTEAM_TASK_CMD_DELETE_WORKREC, "TASK_CMD_DELETE_WORKREC" },
467 { STARTEAM_TASK_CMD_DELETE_TASK_PREDECESSOR, "TASK_CMD_DELETE_TASK_PREDECESSOR" },
468 { STARTEAM_TASK_CMD_GET_TASK_DEPENDENCIES, "TASK_CMD_GET_TASK_DEPENDENCIES" },
469 { STARTEAM_TASK_CMD_ADD_TASK_PREDECESSOR, "TASK_CMD_ADD_TASK_PREDECESSOR" },
470 { STARTEAM_TASK_CMD_UPDATE_TASK_PREDECESSOR, "TASK_CMD_UPDATE_TASK_PREDECESSOR" },
471 { STARTEAM_PROJ_CMD_VIEW_COMPARE_GET_FOLDER_DETAILS, "PROJ_CMD_VIEW_COMPARE_GET_FOLDER_DETAILS" },
472 { STARTEAM_PROJ_CMD_VIEW_COMPARE_RELATE_ITEMS, "PROJ_CMD_VIEW_COMPARE_RELATE_ITEMS" },
473 { 0, NULL }
476 static value_string_ext starteam_opcode_vals_ext = VALUE_STRING_EXT_INIT(starteam_opcode_vals);
478 static gint iPreviousFrameNumber = -1;
480 static void
481 starteam_init(void)
483 iPreviousFrameNumber = -1;
486 static int
487 dissect_starteam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
489 gint offset = 0;
491 col_set_str(pinfo->cinfo, COL_PROTOCOL, "StarTeam");
493 /* This is a trick to know whether this is the first PDU in this packet or not */
494 if(iPreviousFrameNumber != (gint) pinfo->fd->num){
495 col_clear(pinfo->cinfo, COL_INFO);
496 } else {
497 col_append_str(pinfo->cinfo, COL_INFO, " | ");
500 iPreviousFrameNumber = pinfo->fd->num;
501 if(tvb_length(tvb) >= 16){
502 guint32 iCommand = 0;
503 gboolean bRequest = FALSE;
504 if(tvb_get_ntohl(tvb, offset + 0) == STARTEAM_MAGIC){
505 /* This packet is a response */
506 bRequest = FALSE;
507 col_append_fstr(pinfo->cinfo, COL_INFO, "Reply: %d bytes", tvb_length(tvb));
509 } else if(tvb_length_remaining(tvb, offset) >= 28 && tvb_get_ntohl(tvb, offset + 20) == STARTEAM_MAGIC){
510 /* This packet is a request */
511 bRequest = TRUE;
512 if(tvb_length_remaining(tvb, offset) >= 66){
513 iCommand = tvb_get_letohl(tvb, offset + 62);
515 col_append_str(pinfo->cinfo, COL_INFO,
516 val_to_str_ext(iCommand, &starteam_opcode_vals_ext, "Unknown (0x%02x)"));
519 if(tree){
520 proto_tree *starteam_tree;
521 proto_tree *starteamroot_tree;
522 proto_item *ti;
524 ti = proto_tree_add_item(tree, proto_starteam, tvb, offset, -1, ENC_NA);
525 if (bRequest) proto_item_append_text(ti, " (%s)",
526 val_to_str_ext(iCommand, &starteam_opcode_vals_ext, "Unknown (0x%02x)"));
527 starteamroot_tree = proto_item_add_subtree(ti, ett_starteam);
529 if(bRequest){
530 if(tvb_length_remaining(tvb, offset) >= 20){
531 ti = proto_tree_add_text(starteamroot_tree, tvb, offset, 20, STARTEAM_TEXT_MDH);
532 starteam_tree = proto_item_add_subtree(ti, ett_starteam_mdh);
534 proto_tree_add_item(starteam_tree, hf_starteam_mdh_session_tag, tvb, offset + 0, 4, ENC_LITTLE_ENDIAN);
535 proto_tree_add_item(starteam_tree, hf_starteam_mdh_ctimestamp, tvb, offset + 4, 4, ENC_LITTLE_ENDIAN);
536 proto_tree_add_item(starteam_tree, hf_starteam_mdh_flags, tvb, offset + 8, 4, ENC_LITTLE_ENDIAN);
537 proto_tree_add_item(starteam_tree, hf_starteam_mdh_keyid, tvb, offset + 12, 4, ENC_LITTLE_ENDIAN);
538 proto_tree_add_item(starteam_tree, hf_starteam_mdh_reserved, tvb, offset + 16, 4, ENC_LITTLE_ENDIAN);
539 offset += 20;
543 if(tvb_length_remaining(tvb, offset) >= 16){
544 ti = proto_tree_add_text(starteamroot_tree, tvb, offset, 16, STARTEAM_TEXT_PH);
545 starteam_tree = proto_item_add_subtree(ti, ett_starteam_ph);
547 proto_tree_add_item(starteam_tree, hf_starteam_ph_signature, tvb, offset + 0, 4, ENC_ASCII|ENC_NA);
548 proto_tree_add_item(starteam_tree, hf_starteam_ph_packet_size, tvb, offset + 4, 4, ENC_LITTLE_ENDIAN);
549 proto_tree_add_item(starteam_tree, hf_starteam_ph_data_size, tvb, offset + 8, 4, ENC_LITTLE_ENDIAN);
550 proto_tree_add_item(starteam_tree, hf_starteam_ph_data_flags, tvb, offset + 12, 4, ENC_LITTLE_ENDIAN);
551 offset += 16;
553 if(bRequest){
554 if(tvb_length_remaining(tvb, offset) >= 38){
555 ti = proto_tree_add_text(starteamroot_tree, tvb, offset, 38, STARTEAM_TEXT_ID);
556 starteam_tree = proto_item_add_subtree(ti, ett_starteam_id);
558 proto_tree_add_item(starteam_tree, hf_starteam_id_revision_level, tvb, offset + 0, 2, ENC_LITTLE_ENDIAN);
559 proto_tree_add_item(starteam_tree, hf_starteam_id_client, tvb, offset + 2, 16, ENC_ASCII|ENC_NA);
560 proto_tree_add_item(starteam_tree, hf_starteam_id_connect, tvb, offset + 18, 4, ENC_LITTLE_ENDIAN);
561 proto_tree_add_item(starteam_tree, hf_starteam_id_component, tvb, offset + 22, 4, ENC_LITTLE_ENDIAN);
562 proto_tree_add_item(starteam_tree, hf_starteam_id_command, tvb, offset + 26, 4, ENC_LITTLE_ENDIAN);
563 proto_tree_add_item(starteam_tree, hf_starteam_id_command_time, tvb, offset + 30, 4, ENC_LITTLE_ENDIAN);
564 proto_tree_add_item(starteam_tree, hf_starteam_id_command_userid, tvb, offset + 34, 4, ENC_LITTLE_ENDIAN);
565 offset += 38;
568 if(tvb_length_remaining(tvb, offset) > 0){
569 ti = proto_tree_add_text(starteamroot_tree, tvb, offset, -1, STARTEAM_TEXT_DATA);
570 starteam_tree = proto_item_add_subtree(ti, ett_starteam_data);
571 proto_tree_add_item(starteam_tree, hf_starteam_data_data, tvb, offset, tvb_length_remaining(tvb, offset), ENC_ASCII|ENC_NA);
577 return tvb_length(tvb);
580 static guint
581 get_starteam_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
583 guint32 iPDULength = 0;
584 if(tvb_length_remaining(tvb, offset) >= 8 && tvb_get_ntohl(tvb, offset + 0) == STARTEAM_MAGIC){
585 /* Response */
586 iPDULength = tvb_get_letohl(tvb, offset + 4) + 16;
587 } else if(tvb_length_remaining(tvb, offset) >= 28 && tvb_get_ntohl(tvb, offset + 20) == STARTEAM_MAGIC){
588 /* Request */
589 iPDULength = tvb_get_letohl(tvb, offset + 24) + 36;
591 return iPDULength;
594 static int
595 dissect_starteam_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
597 tcp_dissect_pdus(tvb, pinfo, tree, starteam_desegment, 8, get_starteam_pdu_len, dissect_starteam, data);
598 return tvb_length(tvb);
602 static gboolean
603 dissect_starteam_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
605 if(tvb_length(tvb) >= 32){
606 gint iOffsetLengths = -1;
607 if(tvb_get_ntohl(tvb, 0) == STARTEAM_MAGIC){
608 iOffsetLengths = 4;
609 } else if(tvb_get_ntohl(tvb, 20) == STARTEAM_MAGIC){
610 iOffsetLengths = 24;
612 if(iOffsetLengths != -1){
613 guint32 iLengthPacket;
614 guint32 iLengthData;
615 iLengthPacket = tvb_get_letohl(tvb, iOffsetLengths);
616 iLengthData = tvb_get_letohl(tvb, iOffsetLengths + 4);
618 if(iLengthPacket == iLengthData){
619 /* Register this dissector for this conversation */
620 conversation_t *conversation = NULL;
621 conversation = find_or_create_conversation(pinfo);
622 conversation_set_dissector(conversation, starteam_tcp_handle);
624 /* Dissect the packet */
625 dissect_starteam(tvb, pinfo, tree, data);
626 return TRUE;
630 return FALSE;
633 void
634 proto_register_starteam(void)
636 static hf_register_info hf[] = {
637 { &hf_starteam_mdh_session_tag,
638 { "Session tag", "starteam.mdh.stag", FT_UINT32, BASE_DEC, NULL, 0x0, "MDH session tag", HFILL }},
640 { &hf_starteam_mdh_ctimestamp,
641 { "Client timestamp", "starteam.mdh.ctimestamp", FT_UINT32, BASE_DEC, NULL, 0x0, "MDH client timestamp", HFILL }},
643 { &hf_starteam_mdh_flags,
644 { "Flags", "starteam.mdh.flags", FT_UINT32, BASE_HEX, NULL, 0x0, "MDH flags", HFILL }},
646 { &hf_starteam_mdh_keyid,
647 { "Key ID", "starteam.mdh.keyid", FT_UINT32, BASE_HEX, NULL, 0x0, "MDH key ID", HFILL }},
649 { &hf_starteam_mdh_reserved,
650 { "Reserved", "starteam.mdh.reserved", FT_UINT32, BASE_HEX, NULL, 0x0, "MDH reserved", HFILL }},
652 { &hf_starteam_ph_signature,
653 { "Signature", "starteam.ph.signature", FT_STRINGZ, BASE_NONE, NULL, 0x0, "PH signature", HFILL }},
655 { &hf_starteam_ph_packet_size,
656 { "Packet size", "starteam.ph.psize", FT_UINT32, BASE_DEC, NULL, 0x0, "PH packet size", HFILL }},
658 { &hf_starteam_ph_data_size,
659 { "Data size", "starteam.ph.dsize", FT_UINT32, BASE_DEC, NULL, 0x0, "PH data size", HFILL }},
661 { &hf_starteam_ph_data_flags,
662 { "Flags", "starteam.ph.flags", FT_UINT32, BASE_HEX, NULL, 0x0, "PH flags", HFILL }},
664 { &hf_starteam_id_revision_level,
665 { "Revision level", "starteam.id.level", FT_UINT16, BASE_DEC, NULL, 0x0, "ID revision level", HFILL }},
667 { &hf_starteam_id_client,
668 { "Client ID", "starteam.id.client", FT_STRINGZ, BASE_NONE, NULL, 0x0, "ID client ID", HFILL }},
670 { &hf_starteam_id_connect,
671 { "Connect ID", "starteam.id.connect", FT_UINT32, BASE_HEX, NULL, 0x0, "ID connect ID", HFILL }},
673 { &hf_starteam_id_component,
674 { "Component ID", "starteam.id.component", FT_UINT32, BASE_DEC, NULL, 0x0, "ID component ID", HFILL }},
676 { &hf_starteam_id_command,
677 { "Command ID", "starteam.id.command", FT_UINT32, BASE_DEC|BASE_EXT_STRING, &starteam_opcode_vals_ext, 0x0, "ID command ID", HFILL }},
679 { &hf_starteam_id_command_time,
680 { "Command time", "starteam.id.commandtime", FT_UINT32, BASE_HEX, NULL, 0x0, "ID command time", HFILL }},
682 { &hf_starteam_id_command_userid,
683 { "Command user ID", "starteam.id.commanduserid", FT_UINT32, BASE_HEX, NULL, 0x0, "ID command user ID", HFILL }},
685 { &hf_starteam_data_data,
686 { "Data", "starteam.data", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL }}
688 static gint *ett[] = {
689 &ett_starteam,
690 &ett_starteam_mdh,
691 &ett_starteam_ph,
692 &ett_starteam_id,
693 &ett_starteam_data
696 module_t *starteam_module;
698 proto_starteam = proto_register_protocol("StarTeam", "StarTeam", "starteam");
699 proto_register_field_array(proto_starteam, hf, array_length(hf));
700 proto_register_subtree_array(ett, array_length(ett));
702 starteam_module = prefs_register_protocol(proto_starteam, NULL);
703 prefs_register_bool_preference(starteam_module, "desegment",
704 "Reassemble StarTeam messages spanning multiple TCP segments",
705 "Whether the StarTeam dissector should reassemble messages spanning multiple TCP segments."
706 " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
707 &starteam_desegment);
708 register_init_routine(&starteam_init);
711 void
712 proto_reg_handoff_starteam(void)
714 heur_dissector_add("tcp", dissect_starteam_heur, proto_starteam);
715 starteam_tcp_handle = new_create_dissector_handle(dissect_starteam_tcp, proto_starteam);