2 * Routines for synergy dissection
3 * Copyright 2005, Vasanth Manickam <vasanthm@gmail.com>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
14 #include <epan/packet.h>
16 #include "packet-tcp.h"
18 void proto_register_synergy(void);
19 void proto_reg_handoff_synergy(void);
21 #define SYNERGY_PORT 24800 /* Not IANA registered */
23 static int proto_synergy
;
25 static int hf_synergy_packet_len
;
26 static int hf_synergy_packet_type
;
28 static int hf_synergy_unknown
;
29 static int hf_synergy_handshake
;
30 static int hf_synergy_handshake_majorversion
;
31 static int hf_synergy_handshake_minorversion
;
32 static int hf_synergy_handshake_clientname
;
34 static int hf_synergy_cbye
;
36 static int hf_synergy_cinn
;
37 static int hf_synergy_cinn_x
;
38 static int hf_synergy_cinn_y
;
39 static int hf_synergy_cinn_sequence
;
40 static int hf_synergy_cinn_modifiermask
;
42 static int hf_synergy_cout
;
44 static int hf_synergy_cclp
;
45 static int hf_synergy_cclp_clipboardidentifier
;
46 static int hf_synergy_cclp_sequencenumber
;
48 static int hf_synergy_csec
;
50 static int hf_synergy_crop
;
52 static int hf_synergy_ciak
;
54 static int hf_synergy_dkdn
;
55 static int hf_synergy_dkdn_keyid
;
56 static int hf_synergy_dkdn_keymodifiermask
;
57 static int hf_synergy_dkdn_keybutton
;
59 static int hf_synergy_dkrp
;
60 static int hf_synergy_dkrp_keyid
;
61 static int hf_synergy_dkrp_keymodifiermask
;
62 static int hf_synergy_dkrp_numberofrepeats
;
63 static int hf_synergy_dkrp_keybutton
;
65 static int hf_synergy_dkup
;
66 static int hf_synergy_dkup_keyid
;
67 static int hf_synergy_dkup_keymodifiermask
;
68 static int hf_synergy_dkup_keybutton
;
70 static int hf_synergy_dmdn
;
71 static int hf_synergy_dmup
;
73 static int hf_synergy_dmmv
;
74 static int hf_synergy_dmmv_x
;
75 static int hf_synergy_dmmv_y
;
77 static int hf_synergy_dmrm
;
78 static int hf_synergy_dmrm_x
;
79 static int hf_synergy_dmrm_y
;
81 static int hf_synergy_dmwm
;
83 static int hf_synergy_dclp
;
84 static int hf_synergy_dclp_clipboardidentifier
;
85 static int hf_synergy_dclp_sequencenumber
;
86 static int hf_synergy_dclp_clipboarddata
;
88 static int hf_synergy_dinf
;
89 static int hf_synergy_dinf_clp
;
90 static int hf_synergy_dinf_ctp
;
91 static int hf_synergy_dinf_wsp
;
92 static int hf_synergy_dinf_hsp
;
93 static int hf_synergy_dinf_swz
;
94 static int hf_synergy_dinf_x
;
95 static int hf_synergy_dinf_y
;
97 static int hf_synergy_dsop
;
99 static int hf_synergy_qinf
;
101 static int hf_synergy_eicv
;
102 static int hf_synergy_eicv_majorversion
;
103 static int hf_synergy_eicv_minorversion
;
105 static int hf_synergy_ebsy
;
107 static int hf_synergy_eunk
;
109 static int hf_synergy_ebad
;
111 /* Initialize the subtree pointers */
112 static int ett_synergy
;
114 static dissector_handle_t synergy_handle
;
116 static const string_string packet_type_vals
[] = {
118 { "CNOP", "No Operation" },
119 { "CALV", "Keep Alive" },
120 { "CBYE", "Close Connection" },
121 { "CINN", "Enter Screen" },
122 { "COUT", "Leave Screen" },
123 { "CCLP", "Grab Clipboard" },
124 { "CSEC", "Screen Saver Change" },
125 { "CROP", "Reset Options" },
126 { "CIAK", "Resolution Change Acknowledgment" },
127 { "DKDN", "Key Pressed" },
128 { "DKRP", "Key Auto-Repeat" },
129 { "DKUP", "Key Released" },
130 { "DMDN", "Mouse Button Pressed" },
131 { "DMUP", "Mouse Button Released" },
132 { "DMMV", "Mouse Moved" },
133 { "DMRM", "Relative Mouse Move" },
134 { "DMWM", "Mouse Button Pressed" },
135 { "DCLP", "Clipboard Data" },
136 { "DINF", "Client Data" },
137 { "DSOP", "Set Options" },
138 { "QINF", "Query Screen Info" },
139 { "EICV", "Incompatible Versions" },
140 { "EBSY", "Connection Already in Use" },
141 { "EUNK", "Unknown Client" },
142 { "EBAD", "Protocol Violation" },
146 static void dissect_synergy_handshake(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,int offset
);
147 static void dissect_synergy_cinn(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,int offset
);
148 static void dissect_synergy_cclp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,int offset
);
149 static void dissect_synergy_dkdn(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,int offset
);
150 static void dissect_synergy_dkrp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,int offset
);
151 static void dissect_synergy_dkup(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,int offset
);
152 static void dissect_synergy_dmmv(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,int offset
);
153 static void dissect_synergy_dmrm(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,int offset
);
154 static void dissect_synergy_dclp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,int offset
);
155 static void dissect_synergy_dinf(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,int offset
);
156 static void dissect_synergy_eicv(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,int offset
);
159 /* Code to dissect a single Synergy packet */
161 dissect_synergy_pdu(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
164 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "synergy");
165 col_clear(pinfo
->cinfo
, COL_INFO
);
169 const uint8_t* packet_type
;
170 proto_item
*ti
= NULL
;
171 proto_tree
*synergy_tree
= NULL
;
172 ti
= proto_tree_add_protocol_format(tree
, proto_synergy
, tvb
, 0, -1,"Synergy Protocol");
173 synergy_tree
= proto_item_add_subtree(ti
, ett_synergy
);
175 proto_tree_add_item(synergy_tree
,hf_synergy_packet_len
,tvb
,offset
,4,ENC_BIG_ENDIAN
);
177 /* Are the first 7 bytes of the payload "Synergy"?
178 * (Note this never throws an exception)
180 if (tvb_strneql(tvb
, offset
+4, "Synergy", 7) == 0) {
181 /* Yes - dissect as a handshake. */
182 dissect_synergy_handshake(tvb
,pinfo
,synergy_tree
,offset
+11);
184 return tvb_captured_length(tvb
);
187 /* No, so the first 4 bytes of the payload should be a packet type */
188 packet_type
= tvb_get_string_enc(pinfo
->pool
, tvb
, offset
+4, 4, ENC_ASCII
);
189 proto_tree_add_string_format_value(synergy_tree
,hf_synergy_packet_type
,tvb
,offset
+4,4, packet_type
, "%s (%s)", str_to_str(packet_type
, packet_type_vals
, "Unknown"), packet_type
);
191 if(strncmp(packet_type
,"CNOP",4)==0) {
192 } else if(strncmp(packet_type
,"CALV",4)==0) {
193 } else if(strncmp(packet_type
,"CBYE",4)==0) {
194 proto_tree_add_item(synergy_tree
,hf_synergy_cbye
,tvb
,offset
+8,-1,ENC_NA
);
195 } else if(strncmp(packet_type
,"CINN",4)==0) {
196 dissect_synergy_cinn(tvb
,pinfo
,synergy_tree
,offset
+8);
197 } else if(strncmp(packet_type
,"COUT",4)==0) {
198 proto_tree_add_item(synergy_tree
,hf_synergy_cout
,tvb
,offset
+8,-1,ENC_NA
);
199 } else if(strncmp(packet_type
,"CCLP",4)==0) {
200 dissect_synergy_cclp(tvb
,pinfo
,synergy_tree
,offset
+8);
201 } else if(strncmp(packet_type
,"CSEC",4)==0) {
202 proto_tree_add_item(synergy_tree
,hf_synergy_csec
,tvb
,offset
+8,1,ENC_BIG_ENDIAN
);
203 } else if(strncmp(packet_type
,"CROP",4)==0) {
204 proto_tree_add_item(synergy_tree
,hf_synergy_crop
,tvb
,offset
+8,-1,ENC_NA
);
205 } else if(strncmp(packet_type
,"CIAK",4)==0) {
206 proto_tree_add_item(synergy_tree
,hf_synergy_ciak
,tvb
,offset
+8,-1,ENC_NA
);
207 } else if(strncmp(packet_type
,"DKDN",4)==0) {
208 dissect_synergy_dkdn(tvb
,pinfo
,synergy_tree
,offset
+8);
209 } else if(strncmp(packet_type
,"DKRP",4)==0) {
210 dissect_synergy_dkrp(tvb
,pinfo
,synergy_tree
,offset
+8);
211 } else if(strncmp(packet_type
,"DKUP",4)==0) {
212 dissect_synergy_dkup(tvb
,pinfo
,synergy_tree
,offset
+8);
213 } else if(strncmp(packet_type
,"DMDN",4)==0) {
214 proto_tree_add_item(synergy_tree
,hf_synergy_dmdn
,tvb
,offset
+8,1,ENC_BIG_ENDIAN
);
215 } else if(strncmp(packet_type
,"DMUP",4)==0) {
216 proto_tree_add_item(synergy_tree
,hf_synergy_dmup
,tvb
,offset
+8,1,ENC_BIG_ENDIAN
);
217 } else if(strncmp(packet_type
,"DMMV",4)==0) {
218 dissect_synergy_dmmv(tvb
,pinfo
,synergy_tree
,offset
+8);
219 } else if(strncmp(packet_type
,"DMRM",4)==0) {
220 dissect_synergy_dmrm(tvb
,pinfo
,synergy_tree
,offset
+8);
221 } else if(strncmp(packet_type
,"DMWM",4)==0) {
222 proto_tree_add_item(synergy_tree
,hf_synergy_dmwm
,tvb
,offset
+8,2,ENC_BIG_ENDIAN
);
223 } else if(strncmp(packet_type
,"DCLP",4)==0) {
224 dissect_synergy_dclp(tvb
,pinfo
,synergy_tree
,offset
+8);
225 } else if(strncmp(packet_type
,"DINF",4)==0) {
226 dissect_synergy_dinf(tvb
,pinfo
,synergy_tree
,offset
+8);
227 } else if(strncmp(packet_type
,"DSOP",4)==0) {
228 proto_tree_add_item(synergy_tree
,hf_synergy_dsop
,tvb
,offset
+8,4,ENC_BIG_ENDIAN
);
229 } else if(strncmp(packet_type
,"QINF",4)==0) {
230 proto_tree_add_item(synergy_tree
,hf_synergy_qinf
,tvb
,offset
+8,-1,ENC_NA
);
231 } else if(strncmp(packet_type
,"EICV",4)==0) {
232 dissect_synergy_eicv(tvb
,pinfo
,synergy_tree
,offset
+8);
233 } else if(strncmp(packet_type
,"EBSY",4)==0) {
234 proto_tree_add_item(synergy_tree
,hf_synergy_ebsy
,tvb
,offset
+8,-1,ENC_NA
);
235 } else if(strncmp(packet_type
,"EUNK",4)==0) {
236 proto_tree_add_item(synergy_tree
,hf_synergy_eunk
,tvb
,offset
+8,-1,ENC_NA
);
237 } else if(strncmp(packet_type
,"EBAD",4)==0) {
238 proto_tree_add_item(synergy_tree
,hf_synergy_ebad
,tvb
,offset
+8,-1,ENC_NA
);
240 proto_tree_add_item(synergy_tree
,hf_synergy_unknown
,tvb
,offset
+8,-1,ENC_NA
);
244 return tvb_captured_length(tvb
);
247 static void dissect_synergy_handshake( tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
249 proto_item
*ti
= NULL
;
250 proto_tree
*sub_tree
= NULL
;
251 ti
= proto_tree_add_item(tree
, hf_synergy_handshake
, tvb
, offset
, -1, ENC_NA
);
252 sub_tree
= proto_item_add_subtree(ti
, ett_synergy
);
254 proto_tree_add_item(sub_tree
, hf_synergy_handshake_majorversion
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
255 proto_tree_add_item(sub_tree
, hf_synergy_handshake_minorversion
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
257 if (tvb_reported_length_remaining(tvb
, offset
+ 4) != 0)
259 proto_tree_add_item(sub_tree
, hf_synergy_unknown
, tvb
, offset
+ 4, 4, ENC_NA
);
260 proto_tree_add_item(sub_tree
, hf_synergy_handshake_clientname
, tvb
, offset
+ 8, -1, ENC_ASCII
);
264 static void dissect_synergy_cinn( tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
266 proto_item
*ti
= NULL
;
267 proto_tree
*sub_tree
= NULL
;
268 ti
= proto_tree_add_item(tree
, hf_synergy_cinn
, tvb
, offset
, -1, ENC_NA
);
269 sub_tree
= proto_item_add_subtree(ti
, ett_synergy
);
271 proto_tree_add_item(sub_tree
, hf_synergy_cinn_x
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
272 proto_tree_add_item(sub_tree
, hf_synergy_cinn_y
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
273 proto_tree_add_item(sub_tree
, hf_synergy_cinn_sequence
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
274 proto_tree_add_item(sub_tree
, hf_synergy_cinn_modifiermask
, tvb
, offset
+ 8, 2, ENC_BIG_ENDIAN
);
277 static void dissect_synergy_cclp( tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
279 proto_item
*ti
= NULL
;
280 proto_tree
*sub_tree
= NULL
;
281 ti
= proto_tree_add_item(tree
, hf_synergy_cclp
, tvb
, offset
, -1, ENC_NA
);
282 sub_tree
= proto_item_add_subtree(ti
, ett_synergy
);
284 proto_tree_add_item(sub_tree
, hf_synergy_cclp_clipboardidentifier
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
285 proto_tree_add_item(sub_tree
, hf_synergy_cclp_sequencenumber
, tvb
, offset
+ 1, 4, ENC_BIG_ENDIAN
);
288 static void dissect_synergy_dkdn( tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
290 proto_item
*ti
= NULL
;
291 proto_tree
*sub_tree
= NULL
;
292 ti
= proto_tree_add_item(tree
, hf_synergy_dkdn
, tvb
, offset
, -1, ENC_NA
);
293 sub_tree
= proto_item_add_subtree(ti
, ett_synergy
);
295 proto_tree_add_item(sub_tree
, hf_synergy_dkdn_keyid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
296 proto_tree_add_item(sub_tree
, hf_synergy_dkdn_keymodifiermask
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
298 if (tvb_reported_length_remaining(tvb
, offset
+ 4) != 0)
299 proto_tree_add_item(sub_tree
, hf_synergy_dkdn_keybutton
, tvb
, offset
+ 4, 2, ENC_BIG_ENDIAN
);
302 static void dissect_synergy_dkrp( tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
304 proto_item
*ti
= NULL
;
305 proto_tree
*sub_tree
= NULL
;
306 ti
= proto_tree_add_item(tree
, hf_synergy_dkrp
, tvb
, offset
, -1, ENC_NA
);
307 sub_tree
= proto_item_add_subtree(ti
, ett_synergy
);
309 proto_tree_add_item(sub_tree
, hf_synergy_dkrp_keyid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
310 proto_tree_add_item(sub_tree
, hf_synergy_dkrp_keymodifiermask
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
311 proto_tree_add_item(sub_tree
, hf_synergy_dkrp_numberofrepeats
, tvb
, offset
+ 4, 2, ENC_BIG_ENDIAN
);
313 if (tvb_reported_length_remaining(tvb
, offset
+ 6) != 0)
314 proto_tree_add_item(sub_tree
, hf_synergy_dkrp_keybutton
, tvb
, offset
+ 6, 2, ENC_BIG_ENDIAN
);
317 static void dissect_synergy_dkup( tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
319 proto_item
*ti
= NULL
;
320 proto_tree
*sub_tree
= NULL
;
321 ti
= proto_tree_add_item(tree
, hf_synergy_dkup
, tvb
, offset
, -1, ENC_NA
);
322 sub_tree
= proto_item_add_subtree(ti
, ett_synergy
);
324 proto_tree_add_item(sub_tree
, hf_synergy_dkup_keyid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
325 proto_tree_add_item(sub_tree
, hf_synergy_dkup_keymodifiermask
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
327 if (tvb_reported_length_remaining(tvb
, offset
+ 4) != 0)
328 proto_tree_add_item(sub_tree
, hf_synergy_dkup_keybutton
, tvb
, offset
+ 4, 2, ENC_BIG_ENDIAN
);
331 static void dissect_synergy_dmmv( tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
333 proto_item
*ti
= NULL
;
334 proto_tree
*sub_tree
= NULL
;
335 ti
= proto_tree_add_item(tree
, hf_synergy_dmmv
, tvb
, offset
, -1, ENC_NA
);
336 sub_tree
= proto_item_add_subtree(ti
, ett_synergy
);
338 proto_tree_add_item(sub_tree
, hf_synergy_dmmv_x
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
339 proto_tree_add_item(sub_tree
, hf_synergy_dmmv_y
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
342 static void dissect_synergy_dmrm( tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
344 proto_item
*ti
= NULL
;
345 proto_tree
*sub_tree
= NULL
;
346 ti
= proto_tree_add_item(tree
, hf_synergy_dmrm
, tvb
, offset
, -1, ENC_NA
);
347 sub_tree
= proto_item_add_subtree(ti
, ett_synergy
);
349 proto_tree_add_item(sub_tree
, hf_synergy_dmrm_x
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
350 proto_tree_add_item(sub_tree
, hf_synergy_dmrm_y
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
353 static void dissect_synergy_dclp( tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
355 proto_item
*ti
= NULL
;
356 proto_tree
*sub_tree
= NULL
;
357 ti
= proto_tree_add_item(tree
, hf_synergy_dclp
, tvb
, offset
, -1, ENC_NA
);
358 sub_tree
= proto_item_add_subtree(ti
, ett_synergy
);
360 proto_tree_add_item(sub_tree
, hf_synergy_dclp_clipboardidentifier
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
361 proto_tree_add_item(sub_tree
, hf_synergy_dclp_sequencenumber
, tvb
, offset
+ 1, 4, ENC_BIG_ENDIAN
);
362 proto_tree_add_item(sub_tree
, hf_synergy_dclp_clipboarddata
, tvb
, offset
+ 5, -1, ENC_ASCII
);
365 static void dissect_synergy_dinf( tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
367 proto_item
*ti
= NULL
;
368 proto_tree
*sub_tree
= NULL
;
369 ti
= proto_tree_add_item(tree
, hf_synergy_dinf
, tvb
, offset
, -1, ENC_NA
);
370 sub_tree
= proto_item_add_subtree(ti
, ett_synergy
);
372 proto_tree_add_item(sub_tree
, hf_synergy_dinf_clp
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
373 proto_tree_add_item(sub_tree
, hf_synergy_dinf_ctp
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
374 proto_tree_add_item(sub_tree
, hf_synergy_dinf_wsp
, tvb
, offset
+ 4, 2, ENC_BIG_ENDIAN
);
375 proto_tree_add_item(sub_tree
, hf_synergy_dinf_hsp
, tvb
, offset
+ 6, 2, ENC_BIG_ENDIAN
);
376 proto_tree_add_item(sub_tree
, hf_synergy_dinf_swz
, tvb
, offset
+ 8, 2, ENC_BIG_ENDIAN
);
377 proto_tree_add_item(sub_tree
, hf_synergy_dinf_x
, tvb
, offset
+ 10, 2, ENC_BIG_ENDIAN
);
378 proto_tree_add_item(sub_tree
, hf_synergy_dinf_y
, tvb
, offset
+ 12, 2, ENC_BIG_ENDIAN
);
381 static void dissect_synergy_eicv( tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
383 proto_item
*ti
= NULL
;
384 proto_tree
*sub_tree
= NULL
;
385 ti
= proto_tree_add_item(tree
, hf_synergy_eicv
, tvb
, offset
, -1, ENC_NA
);
386 sub_tree
= proto_item_add_subtree(ti
, ett_synergy
);
388 proto_tree_add_item(sub_tree
, hf_synergy_eicv_majorversion
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
389 proto_tree_add_item(sub_tree
, hf_synergy_eicv_minorversion
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
393 synergy_get_pdu_len(packet_info
*pinfo _U_
, tvbuff_t
*tvb
, int offset
, void *data _U_
)
395 return tvb_get_ntohl(tvb
, offset
) + 4;
399 dissect_synergy(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
401 tcp_dissect_pdus(tvb
, pinfo
, tree
, true, 4, synergy_get_pdu_len
,
402 dissect_synergy_pdu
, NULL
);
403 return tvb_captured_length(tvb
);
407 proto_register_synergy(void)
409 static hf_register_info hf
[] = {
411 { &hf_synergy_packet_len
,
412 { "Packet Length","synergy.packet_len",FT_UINT32
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
414 { &hf_synergy_packet_type
,
415 { "Packet Type","synergy.packet_type",FT_STRING
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
417 { &hf_synergy_unknown
,
418 { "unknown","synergy.unknown",FT_NONE
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
420 { &hf_synergy_handshake
,
421 { "Handshake","synergy.handshake",FT_NONE
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
423 { &hf_synergy_handshake_majorversion
,
424 { "Major Version","synergy.handshake.majorversion",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
426 { &hf_synergy_handshake_minorversion
,
427 { "Minor Version","synergy.handshake.minorversion",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
429 { &hf_synergy_handshake_clientname
,
430 { "Client Name","synergy.handshake.client",FT_STRING
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
433 { "Close Connection","synergy.cbye",FT_NONE
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
436 { "Enter Screen","synergy.cinn",FT_NONE
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
438 { &hf_synergy_cinn_x
,
439 { "Screen X","synergy.cinn.x",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
441 { &hf_synergy_cinn_y
,
442 { "Screen Y","synergy.cinn.y",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
444 { &hf_synergy_cinn_sequence
,
445 { "Sequence Number","synergy.cinn.sequence",FT_UINT32
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
447 { &hf_synergy_cinn_modifiermask
,
448 { "Modifier Key Mask","synergy.cinn.mask",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
451 { "Leave Screen","synergy.cout",FT_NONE
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
454 { "Grab Clipboard","synergy.clipboard",FT_NONE
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
456 { &hf_synergy_cclp_clipboardidentifier
,
457 { "Identifier","synergy.clipboard.identifier",FT_UINT8
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
459 { &hf_synergy_cclp_sequencenumber
,
460 { "Sequence Number","synergy.clipboard.sequence",FT_UINT32
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
463 { "Screen Saver Change","synergy.screensaver",FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
466 { "Reset Options","synergy.resetoptions",FT_NONE
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
469 { "Resolution Change Acknowledgment","synergy.ack",FT_NONE
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
472 { "Key Pressed","synergy.keypressed",FT_NONE
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
474 { &hf_synergy_dkdn_keyid
,
475 { "Key Id","synergy.keypressed.keyid",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
477 { &hf_synergy_dkdn_keymodifiermask
,
478 { "Key Modifier Mask","synergy.keypressed.mask",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
480 { &hf_synergy_dkdn_keybutton
,
481 { "Key Button","synergy.keypressed.key",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
484 { "Key Auto-Repeat","synergy.keyautorepeat",FT_NONE
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
486 { &hf_synergy_dkrp_keyid
,
487 { "Key ID","synergy.keyautorepeat.keyid",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
489 { &hf_synergy_dkrp_keymodifiermask
,
490 { "Key modifier Mask","synergy.keyautorepeat.mask",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
492 { &hf_synergy_dkrp_numberofrepeats
,
493 { "Number of Repeats","synergy.keyautorepeat.repeat",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
495 { &hf_synergy_dkrp_keybutton
,
496 { "Key Button","synergy.keyautorepeat.key",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
499 { "Key Released","synergy.keyreleased",FT_NONE
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
501 { &hf_synergy_dkup_keyid
,
502 { "Key Id","synergy.keyreleased.keyid",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
504 { &hf_synergy_dkup_keymodifiermask
,
505 { "Key Modifier Mask","synergy.keyreleased.mask",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
507 { &hf_synergy_dkup_keybutton
,
508 { "Key Button","synergy.keyreleased.key",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
511 { "Mouse Button Pressed","synergy.mousebuttonpressed",FT_UINT8
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
514 { "Mouse Button Released","synergy.mousebuttonreleased",FT_UINT8
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
517 { "Mouse Moved","synergy.mousemoved",FT_NONE
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
519 { &hf_synergy_dmmv_x
,
520 { "X Axis","synergy.mousemoved.x",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
522 { &hf_synergy_dmmv_y
,
523 { "Y Axis","synergy.mousemoved.y",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
526 { "Relative Mouse Move","synergy.relativemousemove",FT_NONE
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
528 { &hf_synergy_dmrm_x
,
529 { "X Axis","synergy.relativemousemove.x",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
531 { &hf_synergy_dmrm_y
,
532 { "Y Axis","synergy.relativemousemove.y",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
535 { "Mouse Button Pressed","synergy.mousebuttonpressed",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
538 { "Clipboard Data","synergy.clipboarddata",FT_NONE
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
540 { &hf_synergy_dclp_clipboardidentifier
,
541 { "Clipboard Identifier","synergy.clipboarddata.identifier",FT_UINT8
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
543 { &hf_synergy_dclp_sequencenumber
,
544 { "Sequence Number","synergy.clipboarddata.sequence",FT_UINT32
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
546 { &hf_synergy_dclp_clipboarddata
,
547 { "Clipboard Data","synergy.clipboarddata.data",FT_STRING
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
550 { "Client Data","synergy.clientdata",FT_NONE
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
552 { &hf_synergy_dinf_clp
,
553 { "coordinate of leftmost pixel on secondary screen","synergy.clps",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
555 { &hf_synergy_dinf_ctp
,
556 { "coordinate of topmost pixel on secondary screen","synergy.clps.ctp",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
558 { &hf_synergy_dinf_wsp
,
559 { "width of secondary screen in pixels","synergy.clps.wsp",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
561 { &hf_synergy_dinf_hsp
,
562 { "height of secondary screen in pixels","synergy.clps.hsp",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
564 { &hf_synergy_dinf_swz
,
565 { "size of warp zone","synergy.clps.swz",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
567 { &hf_synergy_dinf_x
,
568 { "x position of the mouse on the secondary screen","synergy.clps.x",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
570 { &hf_synergy_dinf_y
,
571 { "y position of the mouse on the secondary screen","synergy.clps.y",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
574 { "Set Options","synergy.setoptions",FT_UINT32
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
577 { "Query Screen Info","synergy.qinf",FT_NONE
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
580 { "Incompatible Versions","synergy.eicv",FT_NONE
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
582 { &hf_synergy_eicv_majorversion
,
583 { "Major Version Number","synergy.eicv.major",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
585 { &hf_synergy_eicv_minorversion
,
586 { "Minor Version Number","synergy.eicv.minor",FT_UINT16
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}
589 { "Connection Already in Use","synergy.ebsy",FT_NONE
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
592 { "Unknown Client","synergy.unknown",FT_NONE
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
595 { "Protocol Violation","synergy.violation",FT_NONE
, BASE_NONE
, NULL
, 0x0,NULL
, HFILL
}
600 /* Setup protocol subtree array */
601 static int *ett
[] = {
605 /* Register the protocol name and description */
606 proto_synergy
= proto_register_protocol("Synergy", "Synergy", "synergy");
608 /* Required function calls to register the header fields and subtrees used */
609 proto_register_field_array(proto_synergy
, hf
, array_length(hf
));
610 proto_register_subtree_array(ett
, array_length(ett
));
611 synergy_handle
= register_dissector("synergy", dissect_synergy
, proto_synergy
);
615 proto_reg_handoff_synergy(void)
617 dissector_add_uint_with_preference("tcp.port", SYNERGY_PORT
, synergy_handle
);
621 * Editor modelines - https://www.wireshark.org/tools/modelines.html
626 * indent-tabs-mode: nil
629 * vi: set shiftwidth=4 tabstop=8 expandtab:
630 * :indentSize=4:tabSize=8:noTabs=true: