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