MSWSP: fix dissect_mswsp_smb()
[wireshark-wip.git] / epan / dissectors / packet-synergy.c
blobcd1c741b06ae1ae23904d14edbaf7dcf5788a328
1 /* packet-synergy.c
2 * Routines for synergy dissection
3 * Copyright 2005, Vasanth Manickam <vasanthm@gmail.com>
5 * $Id$
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * 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 #include "config.h"
29 #include <string.h>
31 #include <glib.h>
33 #include <epan/packet.h>
35 void proto_reg_handoff_synergy(void);
38 static int proto_synergy = -1;
40 static int hf_synergy_unknown = -1;
41 static int hf_synergy_handshake = -1;
42 static int hf_synergy_handshake_majorversion = -1;
43 static int hf_synergy_handshake_minorversion = -1;
44 static int hf_synergy_handshake_clientname = -1;
46 static int hf_synergy_cnop = -1;
48 static int hf_synergy_calv = -1;
50 static int hf_synergy_cbye = -1;
52 static int hf_synergy_cinn = -1;
53 static int hf_synergy_cinn_x = -1;
54 static int hf_synergy_cinn_y = -1;
55 static int hf_synergy_cinn_sequence = -1;
56 static int hf_synergy_cinn_modifiermask = -1;
58 static int hf_synergy_cout = -1;
60 static int hf_synergy_cclp = -1;
61 static int hf_synergy_cclp_clipboardidentifier = -1;
62 static int hf_synergy_cclp_sequencenumber = -1;
64 static int hf_synergy_csec = -1;
66 static int hf_synergy_crop = -1;
68 static int hf_synergy_ciak = -1;
70 static int hf_synergy_dkdn = -1;
71 static int hf_synergy_dkdn_keyid = -1;
72 static int hf_synergy_dkdn_keymodifiermask = -1;
73 static int hf_synergy_dkdn_keybutton = -1;
75 static int hf_synergy_dkrp = -1;
76 static int hf_synergy_dkrp_keyid = -1;
77 static int hf_synergy_dkrp_keymodifiermask = -1;
78 static int hf_synergy_dkrp_numberofrepeats = -1;
79 static int hf_synergy_dkrp_keybutton = -1;
81 static int hf_synergy_dkup = -1;
82 static int hf_synergy_dkup_keyid = -1;
83 static int hf_synergy_dkup_keymodifiermask = -1;
84 static int hf_synergy_dkup_keybutton = -1;
86 static int hf_synergy_dmdn = -1;
87 static int hf_synergy_dmup = -1;
89 static int hf_synergy_dmmv = -1;
90 static int hf_synergy_dmmv_x = -1;
91 static int hf_synergy_dmmv_y = -1;
93 static int hf_synergy_dmrm = -1;
94 static int hf_synergy_dmrm_x = -1;
95 static int hf_synergy_dmrm_y = -1;
97 static int hf_synergy_dmwm = -1;
99 static int hf_synergy_dclp = -1;
100 static int hf_synergy_dclp_clipboardidentifier = -1;
101 static int hf_synergy_dclp_sequencenumber = -1;
102 static int hf_synergy_dclp_clipboarddata = -1;
104 static int hf_synergy_dinf = -1;
105 static int hf_synergy_dinf_clp = -1;
106 static int hf_synergy_dinf_ctp= -1;
107 static int hf_synergy_dinf_wsp = -1;
108 static int hf_synergy_dinf_hsp = -1;
109 static int hf_synergy_dinf_swz = -1;
110 static int hf_synergy_dinf_x = -1;
111 static int hf_synergy_dinf_y = -1;
113 static int hf_synergy_dsop = -1;
115 static int hf_synergy_qinf = -1;
117 static int hf_synergy_eicv = -1;
118 static int hf_synergy_eicv_majorversion = -1;
119 static int hf_synergy_eicv_minorversion = -1;
121 static int hf_synergy_ebsy = -1;
123 static int hf_synergy_eunk = -1;
125 static int hf_synergy_ebad = -1;
127 /* Initialize the subtree pointers */
128 static gint ett_synergy = -1;
130 static void dissect_synergy_handshake(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,gint offset);
131 static void dissect_synergy_cinn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,gint offset);
132 static void dissect_synergy_cclp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,gint offset);
133 static void dissect_synergy_dkdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,gint offset);
134 static void dissect_synergy_dkrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,gint offset);
135 static void dissect_synergy_dkup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,gint offset);
136 static void dissect_synergy_dmmv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,gint offset);
137 static void dissect_synergy_dmrm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,gint offset);
138 static void dissect_synergy_dclp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,gint offset);
139 static void dissect_synergy_dinf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,gint offset);
140 static void dissect_synergy_eicv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,gint offset);
143 /* Code to actually dissect the packets */
144 static void
145 dissect_synergy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
148 col_set_str(pinfo->cinfo, COL_PROTOCOL, "synergy");
150 if (tree) {
151 gint offset=0;
152 char buffer[20];
153 proto_item *ti = NULL;
154 proto_tree *synergy_tree = NULL;
155 ti = proto_tree_add_protocol_format(tree, proto_synergy, tvb, 0, -1,"Synergy Protocol");
156 synergy_tree = proto_item_add_subtree(ti, ett_synergy);
158 tvb_get_nstringz(tvb,offset+4,20,(guint8*)buffer);
160 if(strncmp(buffer,"Synergy",7)==0)
161 dissect_synergy_handshake(tvb,pinfo,synergy_tree,offset+4);
162 else if(strncmp(buffer,"CNOP",4)==0)
163 proto_tree_add_item(synergy_tree,hf_synergy_cnop,tvb,offset+4,-1,ENC_NA);
164 else if(strncmp(buffer,"CALV",4)==0)
165 proto_tree_add_item(synergy_tree,hf_synergy_calv,tvb,offset+4,-1,ENC_NA);
166 else if(strncmp(buffer,"CBYE",4)==0)
167 proto_tree_add_item(synergy_tree,hf_synergy_cbye,tvb,offset+4,-1,ENC_NA);
168 else if(strncmp(buffer,"CINN",4)==0)
169 dissect_synergy_cinn(tvb,pinfo,synergy_tree,offset+4);
170 else if(strncmp(buffer,"COUT",4)==0)
171 proto_tree_add_item(synergy_tree,hf_synergy_cout,tvb,offset+4,-1,ENC_NA);
172 else if(strncmp(buffer,"CCLP",4)==0)
173 dissect_synergy_cclp(tvb,pinfo,synergy_tree,offset+4);
174 else if(strncmp(buffer,"CSEC",4)==0)
175 proto_tree_add_item(synergy_tree,hf_synergy_csec,tvb,offset+4,1,ENC_BIG_ENDIAN);
176 else if(strncmp(buffer,"CROP",4)==0)
177 proto_tree_add_item(synergy_tree,hf_synergy_crop,tvb,offset+4,-1,ENC_NA);
178 else if(strncmp(buffer,"CIAK",4)==0)
179 proto_tree_add_item(synergy_tree,hf_synergy_ciak,tvb,offset+4,-1,ENC_NA);
180 else if(strncmp(buffer,"DKDN",4)==0)
181 dissect_synergy_dkdn(tvb,pinfo,synergy_tree,offset+4);
182 else if(strncmp(buffer,"DKRP",4)==0)
183 dissect_synergy_dkrp(tvb,pinfo,synergy_tree,offset+4);
184 else if(strncmp(buffer,"DKUP",4)==0)
185 dissect_synergy_dkup(tvb,pinfo,synergy_tree,offset+4);
186 else if(strncmp(buffer,"DMDN",4)==0)
187 proto_tree_add_item(synergy_tree,hf_synergy_dmdn,tvb,offset+4,1,ENC_BIG_ENDIAN);
188 else if(strncmp(buffer,"DMUP",4)==0)
189 proto_tree_add_item(synergy_tree,hf_synergy_dmup,tvb,offset+4,1,ENC_BIG_ENDIAN);
190 else if(strncmp(buffer,"DMMV",4)==0)
191 dissect_synergy_dmmv(tvb,pinfo,synergy_tree,offset+4);
192 else if(strncmp(buffer,"DMRM",4)==0)
193 dissect_synergy_dmrm(tvb,pinfo,synergy_tree,offset+4);
194 else if(strncmp(buffer,"DMWM",4)==0)
195 proto_tree_add_item(synergy_tree,hf_synergy_dmwm,tvb,offset+4,2,ENC_BIG_ENDIAN);
196 else if(strncmp(buffer,"DCLP",4)==0)
197 dissect_synergy_dclp(tvb,pinfo,synergy_tree,offset+4);
198 else if(strncmp(buffer,"DINF",4)==0)
199 dissect_synergy_dinf(tvb,pinfo,synergy_tree,offset+4);
200 else if(strncmp(buffer,"DSOP",4)==0)
201 proto_tree_add_item(synergy_tree,hf_synergy_dsop,tvb,offset+4,4,ENC_BIG_ENDIAN);
202 else if(strncmp(buffer,"QINF",4)==0)
203 proto_tree_add_item(synergy_tree,hf_synergy_qinf,tvb,offset+4,-1,ENC_NA);
204 else if(strncmp(buffer,"EICV",4)==0)
205 dissect_synergy_eicv(tvb,pinfo,synergy_tree,offset+4);
206 else if(strncmp(buffer,"EBSY",4)==0)
207 proto_tree_add_item(synergy_tree,hf_synergy_ebsy,tvb,offset+4,-1,ENC_NA);
208 else if(strncmp(buffer,"EUNK",4)==0)
209 proto_tree_add_item(synergy_tree,hf_synergy_eunk,tvb,offset+4,-1,ENC_NA);
210 else if(strncmp(buffer,"EBAD",4)==0)
211 proto_tree_add_item(synergy_tree,hf_synergy_ebad,tvb,offset+4,-1,ENC_NA);
212 else
213 proto_tree_add_item(synergy_tree,hf_synergy_unknown,tvb,offset+4,-1,ENC_NA);
217 static void dissect_synergy_handshake( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset )
219 proto_item *ti = NULL;
220 proto_tree *sub_tree = NULL;
221 ti = proto_tree_add_item(tree, hf_synergy_handshake, tvb, offset, -1, ENC_NA);
222 sub_tree = proto_item_add_subtree(ti, ett_synergy);
224 proto_tree_add_item(sub_tree, hf_synergy_handshake_majorversion, tvb, offset + 7, 2, ENC_BIG_ENDIAN);
225 proto_tree_add_item(sub_tree, hf_synergy_handshake_minorversion, tvb, offset + 9, 2, ENC_BIG_ENDIAN);
227 if (tvb_length_remaining(tvb, offset + 11) != 0)
229 proto_tree_add_item(sub_tree, hf_synergy_unknown, tvb, offset + 11, 4, ENC_NA);
230 proto_tree_add_item(sub_tree, hf_synergy_handshake_clientname, tvb, offset + 15, -1, ENC_ASCII|ENC_NA);
234 static void dissect_synergy_cinn( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset )
236 proto_item *ti = NULL;
237 proto_tree *sub_tree = NULL;
238 ti = proto_tree_add_item(tree, hf_synergy_cinn, tvb, offset, -1, ENC_NA);
239 sub_tree = proto_item_add_subtree(ti, ett_synergy);
241 proto_tree_add_item(sub_tree, hf_synergy_cinn_x, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
242 proto_tree_add_item(sub_tree, hf_synergy_cinn_y, tvb, offset + 6, 2, ENC_BIG_ENDIAN);
243 proto_tree_add_item(sub_tree, hf_synergy_cinn_sequence, tvb, offset + 8, 4, ENC_BIG_ENDIAN);
244 proto_tree_add_item(sub_tree, hf_synergy_cinn_modifiermask, tvb, offset + 12, 2, ENC_BIG_ENDIAN);
247 static void dissect_synergy_cclp( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset )
249 proto_item *ti = NULL;
250 proto_tree *sub_tree = NULL;
251 ti = proto_tree_add_item(tree, hf_synergy_cclp, tvb, offset, -1, ENC_NA);
252 sub_tree = proto_item_add_subtree(ti, ett_synergy);
254 proto_tree_add_item(sub_tree, hf_synergy_cclp_clipboardidentifier, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
255 proto_tree_add_item(sub_tree, hf_synergy_cclp_sequencenumber, tvb, offset + 5, 4, ENC_BIG_ENDIAN);
258 static void dissect_synergy_dkdn( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset )
260 proto_item *ti = NULL;
261 proto_tree *sub_tree = NULL;
262 ti = proto_tree_add_item(tree, hf_synergy_dkdn, tvb, offset, -1, ENC_NA);
263 sub_tree = proto_item_add_subtree(ti, ett_synergy);
265 proto_tree_add_item(sub_tree, hf_synergy_dkdn_keyid, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
266 proto_tree_add_item(sub_tree, hf_synergy_dkdn_keymodifiermask, tvb, offset + 6, 2, ENC_BIG_ENDIAN);
268 if (tvb_length_remaining(tvb, offset + 8) != 0)
269 proto_tree_add_item(sub_tree, hf_synergy_dkdn_keybutton, tvb, offset + 8, 2, ENC_BIG_ENDIAN);
272 static void dissect_synergy_dkrp( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset )
274 proto_item *ti = NULL;
275 proto_tree *sub_tree = NULL;
276 ti = proto_tree_add_item(tree, hf_synergy_dkrp, tvb, offset, -1, ENC_NA);
277 sub_tree = proto_item_add_subtree(ti, ett_synergy);
279 proto_tree_add_item(sub_tree, hf_synergy_dkrp_keyid, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
280 proto_tree_add_item(sub_tree, hf_synergy_dkrp_keymodifiermask, tvb, offset + 6, 2, ENC_BIG_ENDIAN);
281 proto_tree_add_item(sub_tree, hf_synergy_dkrp_numberofrepeats, tvb, offset + 8, 2, ENC_BIG_ENDIAN);
283 if (tvb_length_remaining(tvb, offset + 10) != 0)
284 proto_tree_add_item(sub_tree, hf_synergy_dkrp_keybutton, tvb, offset + 10, 2, ENC_BIG_ENDIAN);
287 static void dissect_synergy_dkup( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset )
289 proto_item *ti = NULL;
290 proto_tree *sub_tree = NULL;
291 ti = proto_tree_add_item(tree, hf_synergy_dkup, tvb, offset, -1, ENC_NA);
292 sub_tree = proto_item_add_subtree(ti, ett_synergy);
294 proto_tree_add_item(sub_tree, hf_synergy_dkup_keyid, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
295 proto_tree_add_item(sub_tree, hf_synergy_dkup_keymodifiermask, tvb, offset + 6, 2, ENC_BIG_ENDIAN);
297 if (tvb_length_remaining(tvb, offset + 8) != 0)
298 proto_tree_add_item(sub_tree, hf_synergy_dkup_keybutton, tvb, offset + 8, 2, ENC_BIG_ENDIAN);
301 static void dissect_synergy_dmmv( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset )
303 proto_item *ti = NULL;
304 proto_tree *sub_tree = NULL;
305 ti = proto_tree_add_item(tree, hf_synergy_dmmv, tvb, offset, -1, ENC_NA);
306 sub_tree = proto_item_add_subtree(ti, ett_synergy);
308 proto_tree_add_item(sub_tree, hf_synergy_dmmv_x, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
309 proto_tree_add_item(sub_tree, hf_synergy_dmmv_y, tvb, offset + 6, 2, ENC_BIG_ENDIAN);
312 static void dissect_synergy_dmrm( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset )
314 proto_item *ti = NULL;
315 proto_tree *sub_tree = NULL;
316 ti = proto_tree_add_item(tree, hf_synergy_dmrm, tvb, offset, -1, ENC_NA);
317 sub_tree = proto_item_add_subtree(ti, ett_synergy);
319 proto_tree_add_item(sub_tree, hf_synergy_dmrm_x, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
320 proto_tree_add_item(sub_tree, hf_synergy_dmrm_y, tvb, offset + 6, 2, ENC_BIG_ENDIAN);
323 static void dissect_synergy_dclp( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset )
325 proto_item *ti = NULL;
326 proto_tree *sub_tree = NULL;
327 ti = proto_tree_add_item(tree, hf_synergy_dclp, tvb, offset, -1, ENC_NA);
328 sub_tree = proto_item_add_subtree(ti, ett_synergy);
330 proto_tree_add_item(sub_tree, hf_synergy_dclp_clipboardidentifier, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
331 proto_tree_add_item(sub_tree, hf_synergy_dclp_sequencenumber, tvb, offset + 5, 4, ENC_BIG_ENDIAN);
332 proto_tree_add_item(sub_tree, hf_synergy_dclp_clipboarddata, tvb, offset + 9, -1, ENC_ASCII|ENC_NA);
335 static void dissect_synergy_dinf( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset )
337 proto_item *ti = NULL;
338 proto_tree *sub_tree = NULL;
339 ti = proto_tree_add_item(tree, hf_synergy_dinf, tvb, offset, -1, ENC_NA);
340 sub_tree = proto_item_add_subtree(ti, ett_synergy);
342 proto_tree_add_item(sub_tree, hf_synergy_dinf_clp, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
343 proto_tree_add_item(sub_tree, hf_synergy_dinf_ctp, tvb, offset + 6, 2, ENC_BIG_ENDIAN);
344 proto_tree_add_item(sub_tree, hf_synergy_dinf_wsp, tvb, offset + 8, 2, ENC_BIG_ENDIAN);
345 proto_tree_add_item(sub_tree, hf_synergy_dinf_hsp, tvb, offset + 10, 2, ENC_BIG_ENDIAN);
346 proto_tree_add_item(sub_tree, hf_synergy_dinf_swz, tvb, offset + 12, 2, ENC_BIG_ENDIAN);
347 proto_tree_add_item(sub_tree, hf_synergy_dinf_x, tvb, offset + 14, 2, ENC_BIG_ENDIAN);
348 proto_tree_add_item(sub_tree, hf_synergy_dinf_y, tvb, offset + 16, 2, ENC_BIG_ENDIAN);
351 static void dissect_synergy_eicv( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset )
353 proto_item *ti = NULL;
354 proto_tree *sub_tree = NULL;
355 ti = proto_tree_add_item(tree, hf_synergy_eicv, tvb, offset, -1, ENC_NA);
356 sub_tree = proto_item_add_subtree(ti, ett_synergy);
358 proto_tree_add_item(sub_tree, hf_synergy_eicv_majorversion, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
359 proto_tree_add_item(sub_tree, hf_synergy_eicv_minorversion, tvb, offset + 6, 2, ENC_BIG_ENDIAN);
363 void
364 proto_register_synergy(void)
366 static hf_register_info hf[] = {
368 { &hf_synergy_unknown,
369 { "unknown","synergy.unknown",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
371 { &hf_synergy_handshake,
372 { "Handshake","synergy.handshake",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
374 { &hf_synergy_handshake_majorversion,
375 { "Major Version","synergy.handshake.majorversion",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
377 { &hf_synergy_handshake_minorversion,
378 { "Minor Version","synergy.handshake.minorversion",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
380 { &hf_synergy_handshake_clientname,
381 { "Client Name","synergy.handshake.client",FT_STRING, BASE_NONE, NULL, 0x0,NULL, HFILL }
383 { &hf_synergy_calv,
384 { "Keep Alive","synergy.calv",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
386 { &hf_synergy_cnop,
387 { "No Operation","synergy.cnop",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
389 { &hf_synergy_cbye,
390 { "Close Connection","synergy.cbye",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
392 { &hf_synergy_cinn,
393 { "Enter Screen","synergy.cinn",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
395 { &hf_synergy_cinn_x,
396 { "Screen X","synergy.cinn.x",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
398 { &hf_synergy_cinn_y,
399 { "Screen Y","synergy.cinn.y",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
401 { &hf_synergy_cinn_sequence,
402 { "Sequence Number","synergy.cinn.sequence",FT_UINT32, BASE_DEC, NULL, 0x0,NULL, HFILL }
404 { &hf_synergy_cinn_modifiermask,
405 { "Modifier Key Mask","synergy.cinn.mask",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
407 { &hf_synergy_cout,
408 { "Leave Screen","synergy.cout",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
410 { &hf_synergy_cclp,
411 { "Grab Clipboard","synergy.clipboard",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
413 { &hf_synergy_cclp_clipboardidentifier,
414 { "Identifier","synergy.clipboard.identifier",FT_UINT8, BASE_DEC, NULL, 0x0,NULL, HFILL }
416 { &hf_synergy_cclp_sequencenumber,
417 { "Sequence Number","synergy.clipboard.sequence",FT_UINT32, BASE_DEC, NULL, 0x0,NULL, HFILL }
419 { &hf_synergy_csec,
420 { "Screen Saver Change","synergy.screensaver",FT_BOOLEAN, BASE_NONE, NULL, 0x0,NULL, HFILL }
422 { &hf_synergy_crop,
423 { "Reset Options","synergy.resetoptions",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
425 { &hf_synergy_ciak,
426 { "resolution change acknowledgment","synergy.ack",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
428 { &hf_synergy_dkdn,
429 { "Key Pressed","synergy.keypressed",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
431 { &hf_synergy_dkdn_keyid,
432 { "Key Id","synergy.keypressed.keyid",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
434 { &hf_synergy_dkdn_keymodifiermask,
435 { "Key Modifier Mask","synergy.keypressed.mask",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
437 { &hf_synergy_dkdn_keybutton,
438 { "Key Button","synergy.keypressed.key",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
440 { &hf_synergy_dkrp,
441 { "key auto-repeat","synergy.keyautorepeat",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
443 { &hf_synergy_dkrp_keyid,
444 { "Key ID","synergy.keyautorepeat.keyid",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
446 { &hf_synergy_dkrp_keymodifiermask,
447 { "Key modifier Mask","synergy.keyautorepeat.mask",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
449 { &hf_synergy_dkrp_numberofrepeats,
450 { "Number of Repeats","synergy.keyautorepeat.repeat",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
452 { &hf_synergy_dkrp_keybutton,
453 { "Key Button","synergy.keyautorepeat.key",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
455 { &hf_synergy_dkup,
456 { "key released","synergy.keyreleased",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
458 { &hf_synergy_dkup_keyid,
459 { "Key Id","synergy.keyreleased.keyid",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
461 { &hf_synergy_dkup_keymodifiermask,
462 { "Key Modifier Mask","synergy.keyreleased.mask",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
464 { &hf_synergy_dkup_keybutton,
465 { "Key Button","synergy.keyreleased.key",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
467 { &hf_synergy_dmdn,
468 { "Mouse Button Pressed","synergy.mousebuttonpressed",FT_UINT8, BASE_DEC, NULL, 0x0,NULL, HFILL }
470 { &hf_synergy_dmup,
471 { "Mouse Button Released","synergy.mousebuttonreleased",FT_UINT8, BASE_DEC, NULL, 0x0,NULL, HFILL }
473 { &hf_synergy_dmmv,
474 { "Mouse Moved","synergy.mousemoved",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
476 { &hf_synergy_dmmv_x,
477 { "X Axis","synergy.mousemoved.x",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
479 { &hf_synergy_dmmv_y,
480 { "Y Axis","synergy.mousemoved.y",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
482 { &hf_synergy_dmrm,
483 { "Relative Mouse Move","synergy.relativemousemove",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
485 { &hf_synergy_dmrm_x,
486 { "X Axis","synergy.relativemousemove.x",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
488 { &hf_synergy_dmrm_y,
489 { "Y Axis","synergy.relativemousemove.y",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
491 { &hf_synergy_dmwm,
492 { "Mouse Button Pressed","synergy.mousebuttonpressed",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
494 { &hf_synergy_dclp,
495 { "Clipboard Data","synergy.clipboarddata",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
497 { &hf_synergy_dclp_clipboardidentifier,
498 { "Clipboard Identifier","synergy.clipboarddata.identifier",FT_UINT8, BASE_DEC, NULL, 0x0,NULL, HFILL }
500 { &hf_synergy_dclp_sequencenumber,
501 { "Sequence Number","synergy.clipboarddata.sequence",FT_UINT32, BASE_DEC, NULL, 0x0,NULL, HFILL }
503 { &hf_synergy_dclp_clipboarddata,
504 { "Clipboard Data","synergy.clipboarddata.data",FT_STRING, BASE_NONE, NULL, 0x0,NULL, HFILL }
506 { &hf_synergy_dinf,
507 { "Client Data","synergy.clientdata",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
509 { &hf_synergy_dinf_clp,
510 { "coordinate of leftmost pixel on secondary screen","synergy.clps",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
512 { &hf_synergy_dinf_ctp,
513 { "coordinate of topmost pixel on secondary screen","synergy.clps.ctp",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
515 { &hf_synergy_dinf_wsp,
516 { "width of secondary screen in pixels","synergy.clps.wsp",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
518 { &hf_synergy_dinf_hsp,
519 { "height of secondary screen in pixels","synergy.clps.hsp",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
521 { &hf_synergy_dinf_swz,
522 { "size of warp zone","synergy.clps.swz",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
524 { &hf_synergy_dinf_x,
525 { "x position of the mouse on the secondary screen","synergy.clps.x",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
527 { &hf_synergy_dinf_y,
528 { "y position of the mouse on the secondary screen","synergy.clps.y",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
530 { &hf_synergy_dsop,
531 { "Set Options","synergy.setoptions",FT_UINT32, BASE_DEC, NULL, 0x0,NULL, HFILL }
533 { &hf_synergy_qinf,
534 { "Query Screen Info","synergy.qinf",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
536 { &hf_synergy_eicv,
537 { "incompatible versions","synergy.eicv",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
539 { &hf_synergy_eicv_majorversion,
540 { "Major Version Number","synergy.eicv.major",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
542 { &hf_synergy_eicv_minorversion,
543 { "Minor Version Number","synergy.eicv.minor",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL }
545 { &hf_synergy_ebsy,
546 { "Connection Already in Use","synergy.ebsy",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
548 { &hf_synergy_eunk,
549 { "Unknown Client","synergy.unknown",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
551 { &hf_synergy_ebad,
552 { "protocol violation","synergy.violation",FT_NONE, BASE_NONE, NULL, 0x0,NULL, HFILL }
557 /* Setup protocol subtree array */
558 static gint *ett[] = {
559 &ett_synergy,
562 /* Register the protocol name and description */
563 proto_synergy = proto_register_protocol("Synergy",
564 "Synergy", "synergy");
566 /* Required function calls to register the header fields and subtrees used */
567 proto_register_field_array(proto_synergy, hf, array_length(hf));
568 proto_register_subtree_array(ett, array_length(ett));
569 register_dissector("synergy", dissect_synergy, proto_synergy);
576 void
577 proto_reg_handoff_synergy(void)
580 dissector_handle_t synergy_handle;
581 synergy_handle = find_dissector("synergy");
582 dissector_add_uint("tcp.port",24800, synergy_handle);