HACK: pinfo->private_data points to smb_info again
[wireshark-wip.git] / epan / dissectors / packet-cast.c
blob4370628af68e5ad5f98493ff43da971fd68de620
1 /* packet-cast.c
3 * Dissector for the CAST Client Control Protocol
4 * (The "D-Channel"-Protocol for Cisco Systems' IP-Phones)
6 * $Id$
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 /* This implementation is based on a draft version of the 3.0
24 * specification
27 #include "config.h"
29 #include <epan/packet.h>
30 #include <epan/prefs.h>
32 #include "packet-tcp.h"
34 #define TCP_PORT_CAST 4224
36 void proto_register_cast(void);
37 void proto_reg_handoff_cast(void);
39 /* I will probably need this again when I change things
40 * to function pointers, but let me use the existing
41 * infrastructure for now
43 * typedef struct {
44 * guint32 id;
45 * char *name;
46 * } message_id_t;
49 static const value_string message_id[] = {
51 {0x0000, "KeepAliveMessage"},
52 {0x0001, "KeepAliveVersionMessage"},
53 {0x0002, "KeepAliveVersionACKMessage"},
54 {0x0003, "UpdateCapabilitiesMessage"},
55 {0x0004, "EmptyCapabilitiesMessage"},
56 {0x0005, "OpenMultiMediaReceiveChannelMessage"},
57 {0x0006, "OpenMultiMediaReceiveChannelACKMessage"},
58 {0x0007, "CloseMultiMediaReceiveChannelMessage"},
59 {0x0008, "StartMultiMediaTransmissionMessage"},
60 {0x0009, "StopMultiMediaTransmissionMessage"},
61 {0x000A, "MiscellaneousCommandMessage"},
62 {0x000B, "FlowControlCommandMessage"},
63 {0x000C, "ClearConferenceMessage"},
64 {0x000D, "CallStateMessage"},
65 {0x000E, "RequestCallStateMessage"},
66 {0x000F, "RequestAllCallStatesMessage"},
67 {0x0010, "CallInfoMessage"},
68 {0x0011, "RequestCallInfoMessage"},
69 {0x0012, "CallFocusMessage"},
70 {0x0013, "MakeCallMessage"},
71 {0x0014, "HangUpMessage"},
72 {0x0015, "AnswerMessage"},
74 {0x0040, "KeepAliveACKMessage"},
75 {0x0041, "StreamStartMessage"},
76 {0x0042, "StreamStopMessage"},
77 {0x0043, "MuteStartMessage"},
78 {0x0044, "MuteStopMessage"},
79 {0x0045, "SpeakerStartMessage"},
80 {0x0046, "SpeakerStopMessage"},
81 {0x0047, "StreamStartMessageWithCodec"},
83 {0x0050, "VIEODiscoveryprotocol"},
84 {0x0051, "VIEOControlprotocol"},
86 {0x0060, "T120protocol"},
87 {0x0061, "T121protocol"},
88 {0x0062, "T122protocol"},
90 {0x0070, "IMSessionDiscoveryprotocol"},
91 {0x0071, "IMSessionControlprotocol"},
93 {0x0074, "SlidesDiscoveryprotocol"},
94 {0x0075, "SlidesControlprotocol"},
96 {0x0080, "CastTunnelMessage"},
98 {0x0090, "RemoteRequestMessage"},
99 {0x0091, "RemoteResponseMessage"},
101 {0x00A0, "CollabDiscoveryprotocol"},
102 {0x00A1, "CollabControlprotocol"},
104 {0x00A4, "FECCDiscoveryprotocol"},
105 {0x00A5, "FECCControlprotocol"},
107 {0x00B0, "ClockSyncprotocol"},
108 {0x00B1, "StreamSyncprotocol"},
110 {0x00B4, "MediaDiscoveryprotocol"},
111 {0x00B5, "MediaControlprotocol"},
113 {0x00C0, "SessionDiscoveryprotocol"},
114 {0x00C1, "SessionControlprotocol"},
116 {0x00C4, "ConferenceDiscoveryprotocol"},
117 {0x00C5, "Conferenceprotocol"},
119 {0x00CC, "SCCPCallControlProxyprotocol"},
121 {0x00D0, "CallDiscoveryprotocol"},
122 {0x00D1, "CallControlprotocol"},
124 {0 , NULL} /* terminator */
127 static const value_string audioCodecTypes[] = {
128 {1 , "G711"},
129 {1 , "G729"},
130 {2 , "GSM"},
131 {3 , "G723"},
132 {4 , "G722"},
133 {5 , "WideBand"},
134 { 0 , NULL}
137 static const value_string orcStatus[] = {
138 {0 , "orcOk"},
139 {1 , "orcError"},
140 {0 , NULL}
143 static const value_string mediaPayloads[] = {
144 { 1 , "Non-standard codec"},
145 { 2 , "G.711 A-law 64k"},
146 { 3 , "G.711 A-law 56k"},
147 { 4 , "G.711 u-law 64k"},
148 { 5 , "G.711 u-law 56k"},
149 { 6 , "G.722 64k"},
150 { 7 , "G.722 56k"},
151 { 8 , "G.722 48k"},
152 { 9 , "G.723.1"},
153 { 10 , "G.728"},
154 { 11 , "G.729"},
155 { 12 , "G.729 Annex A"},
156 { 13 , "IS11172 AudioCap"}, /* IS11172 is an ISO MPEG standard */
157 { 14 , "IS13818 AudioCap"}, /* IS13818 is an ISO MPEG standard */
158 { 15 , "G.729 Annex B"},
159 { 16 , "G.729 Annex A+Annex B"},
160 { 18 , "GSM Full Rate"},
161 { 19 , "GSM Half Rate"},
162 { 20 , "GSM Enhanced Full Rate"},
163 { 25 , "Wideband 256k"},
164 { 32 , "Data 64k"},
165 { 33 , "Data 56k"},
166 { 80 , "GSM"},
167 { 81 , "ActiveVoice"},
168 { 82 , "G.726 32K"},
169 { 83 , "G.726 24K"},
170 { 84 , "G.726 16K"},
171 { 85 , "G.729B"},
172 { 86 , "G.729B Low Complexity"},
173 {100 , "H261"},
174 {101 , "H263"},
175 {102 , "Vieo"},
176 {105 , "T120"},
177 {106 , "H224"},
178 {257 , "RFC2833_DynPayload"},
179 {0 , NULL}
182 static const value_string cast_Layouts[] = {
183 { 0 , "NoLayout"},
184 { 1 , "OneByOne"},
185 { 2 , "OneByTwo"},
186 { 3 , "TwoByTwo"},
187 { 4 , "TwoByTwo3Alt1"},
188 { 5 , "TwoByTwo3Alt2"},
189 { 6 , "ThreeByThree"},
190 { 7 , "ThreeByThree6Alt1"},
191 { 8 , "ThreeByThree6Alt2"},
192 { 9 , "ThreeByThree4Alt1"},
193 {10 , "ThreeByThree4Alt2"},
194 {0 , NULL}
197 static const value_string cast_transmitOrReceive[] = {
198 {1 , "Station_Receive_only"},
199 {2 , "Station_Transmit_only"},
200 {3 , "Station_Receive_Transmit"},
201 {0 , NULL}
204 static const value_string cast_formatTypes[] = {
205 {1 , "sqcif (128x96)"},
206 {2 , "qcif (176x144)"},
207 {3 , "cif (352x288)"},
208 {4 , "4cif (704x576)"},
209 {5 , "16cif (1408x1152)"},
210 {6 , "custom_base"},
211 {0 , NULL}
214 static const value_string cast_echoCancelTypes[] = {
215 {0 , "Media_EchoCancellation_Off"},
216 {1 , "Media_EchoCancellation_On"},
217 {0 , NULL}
220 static const value_string cast_g723BitRates[] = {
221 {1 , "Media_G723BRate_5_3"},
222 {2 , "Media_G723BRate_6_4"},
223 {0 , NULL}
226 static const value_string cast_miscCommandType[] = {
227 {0 , "videoFreezePicture"},
228 {1 , "videoFastUpdatePicture"},
229 {2 , "videoFastUpdateGOB"},
230 {3 , "videoFastUpdateMB"},
231 {4 , "lostPicture"},
232 {5 , "lostPartialPicture"},
233 {6 , "recoveryReferencePicture"},
234 {7 , "temporalSpatialTradeOff"},
235 {0 , NULL}
238 static const value_string cast_callStateTypes[] = {
239 { 0 , "TsIdle"},
240 { 1 , "TsOffHook"},
241 { 2 , "TsOnHook"},
242 { 3 , "TsRingOut"},
243 { 4 , "TsRingIn"},
244 { 5 , "TsConnected"},
245 { 6 , "TsBusy"},
246 { 7 , "TsCongestion"},
247 { 8 , "TsHold"},
248 { 9 , "TsCallWaiting"},
249 {10 , "TsCallTransfer"},
250 {11 , "TsCallPark"},
251 {12 , "TsProceed"},
252 {13 , "TsCallRemoteMultiline"},
253 {14 , "TsInvalidNumber"},
254 {15 , "TsMaxState"},
255 {0 , NULL}
258 /* Defined Call Type */
259 static const value_string cast_callTypes[] = {
260 {1 , "InBoundCall"},
261 {2 , "OutBoundCall"},
262 {3 , "ForwardCall"},
263 {0 , NULL}
266 static const value_string cast_callSecurityStatusTypes[] = {
267 {0 , "CallSecurityStatusUnknown"},
268 {1 , "CallSecurityStatusNotAuthenticated"},
269 {2 , "CallSecurityStatusAuthenticated"},
270 {0 , NULL}
274 #define MAX_CUSTOM_PICTURES 6
275 #define MAX_SERVICE_TYPE 4
276 #define MAX_LAYOUT_WITH_SAME_SERVICE 5
277 #define MAX_PICTURE_FORMAT 5
278 #define MAX_REFERENCE_PICTURE 4
279 #define MAX_LEVEL_PREFERENCE 4
280 #define StationMaxVideoCapabilities 10
281 #define StationMaxDataCapabilities 5
282 #define StationMaxNameSize 40 /* max size of calling party's name */
283 #define StationMaxDirnumSize 24 /* max size of calling or called party dirnum */
286 /* Initialize the protocol and registered fields */
287 static int proto_cast = -1;
288 static int hf_cast_data_length = -1;
289 static int hf_cast_reserved = -1;
290 static int hf_cast_messageid = -1;
291 static int hf_cast_version = -1;
292 static int hf_cast_ORCStatus = -1;
293 static int hf_cast_ipAddress = -1;
294 static int hf_cast_portNumber = -1;
295 static int hf_cast_passThruPartyID = -1;
296 static int hf_cast_callIdentifier = -1;
297 static int hf_cast_conferenceID = -1;
298 static int hf_cast_payloadType = -1;
299 static int hf_cast_lineInstance = -1;
300 static int hf_cast_payloadCapability = -1;
301 static int hf_cast_isConferenceCreator = -1;
302 static int hf_cast_payload_rfc_number = -1;
303 static int hf_cast_videoCapCount = -1;
304 static int hf_cast_dataCapCount = -1;
305 static int hf_cast_RTPPayloadFormat = -1;
306 static int hf_cast_customPictureFormatCount = -1;
307 static int hf_cast_pictureWidth = -1;
308 static int hf_cast_pictureHeight = -1;
309 static int hf_cast_pixelAspectRatio = -1;
310 static int hf_cast_clockConversionCode = -1;
311 static int hf_cast_clockDivisor = -1;
312 static int hf_cast_activeStreamsOnRegistration = -1;
313 static int hf_cast_maxBW = -1;
314 static int hf_cast_serviceResourceCount = -1;
315 static int hf_cast_layoutCount = -1;
316 static int hf_cast_layout = -1;
317 static int hf_cast_maxConferences = -1;
318 static int hf_cast_activeConferenceOnRegistration = -1;
319 static int hf_cast_transmitOrReceive = -1;
320 static int hf_cast_levelPreferenceCount = -1;
321 static int hf_cast_transmitPreference = -1;
322 static int hf_cast_format = -1;
323 static int hf_cast_maxBitRate = -1;
324 static int hf_cast_minBitRate = -1;
325 static int hf_cast_MPI = -1;
326 static int hf_cast_serviceNumber = -1;
327 static int hf_cast_temporalSpatialTradeOffCapability = -1;
328 static int hf_cast_stillImageTransmission = -1;
329 static int hf_cast_h263_capability_bitfield = -1;
330 static int hf_cast_annexNandWFutureUse = -1;
331 static int hf_cast_modelNumber = -1;
332 static int hf_cast_bandwidth = -1;
333 static int hf_cast_protocolDependentData = -1;
334 static int hf_cast_DSCPValue = -1;
335 static int hf_cast_serviceNum = -1;
336 /* static int hf_cast_precedenceValue = -1; */
337 static int hf_cast_maxStreams = -1;
338 static int hf_cast_millisecondPacketSize = -1;
339 static int hf_cast_echoCancelType = -1;
340 static int hf_cast_g723BitRate = -1;
341 static int hf_cast_bitRate = -1;
342 static int hf_cast_pictureFormatCount = -1;
343 static int hf_cast_confServiceNum = -1;
344 static int hf_cast_miscCommandType = -1;
345 static int hf_cast_temporalSpatialTradeOff = -1;
346 static int hf_cast_firstGOB = -1;
347 static int hf_cast_numberOfGOBs = -1;
348 static int hf_cast_firstMB = -1;
349 static int hf_cast_numberOfMBs = -1;
350 static int hf_cast_pictureNumber = -1;
351 static int hf_cast_longTermPictureIndex = -1;
352 static int hf_cast_recoveryReferencePictureCount = -1;
353 static int hf_cast_calledParty = -1;
354 static int hf_cast_privacy = -1;
355 static int hf_cast_precedenceLv = -1;
356 static int hf_cast_precedenceDm = -1;
357 static int hf_cast_callState = -1;
358 static int hf_cast_callingPartyName = -1;
359 static int hf_cast_callingParty = -1;
360 static int hf_cast_calledPartyName = -1;
361 static int hf_cast_callType = -1;
362 static int hf_cast_originalCalledPartyName = -1;
363 static int hf_cast_originalCalledParty = -1;
364 static int hf_cast_lastRedirectingPartyName = -1;
365 static int hf_cast_lastRedirectingParty = -1;
366 static int hf_cast_cgpnVoiceMailbox = -1;
367 static int hf_cast_cdpnVoiceMailbox = -1;
368 static int hf_cast_originalCdpnVoiceMailbox = -1;
369 static int hf_cast_lastRedirectingVoiceMailbox = -1;
370 static int hf_cast_originalCdpnRedirectReason = -1;
371 static int hf_cast_lastRedirectingReason = -1;
372 static int hf_cast_callInstance = -1;
373 static int hf_cast_callSecurityStatus = -1;
374 static int hf_cast_partyPIRestrictionBits_CallingPartyName = -1;
375 static int hf_cast_partyPIRestrictionBits_CallingPartyNumber = -1;
376 static int hf_cast_partyPIRestrictionBits_CalledPartyName = -1;
377 static int hf_cast_partyPIRestrictionBits_CalledPartyNumber = -1;
378 static int hf_cast_partyPIRestrictionBits_OriginalCalledPartyName = -1;
379 static int hf_cast_partyPIRestrictionBits_OriginalCalledPartyNumber = -1;
380 static int hf_cast_partyPIRestrictionBits_LastRedirectPartyName = -1;
381 static int hf_cast_partyPIRestrictionBits_LastRedirectPartyNumber = -1;
382 static int hf_cast_directoryNumber = -1;
383 static int hf_cast_requestorIpAddress = -1;
384 static int hf_cast_stationIpAddress = -1;
385 static int hf_cast_stationFriendlyName = -1;
386 static int hf_cast_stationGUID = -1;
387 static int hf_cast_audio = -1;
391 /* Initialize the subtree pointers */
392 static gint ett_cast = -1;
393 static gint ett_cast_tree = -1;
395 /* desegmentation of SCCP */
396 static gboolean cast_desegment = TRUE;
398 static dissector_handle_t data_handle;
400 /* Dissect a single CAST PDU */
401 static int
402 dissect_cast_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
404 int offset = 0;
406 /* Header fields */
407 guint32 hdr_data_length;
408 guint32 hdr_marker;
409 guint32 data_messageid;
410 const gchar *messageid_str;
411 /* guint32 data_size; */
413 guint i = 0;
414 guint t = 0;
415 int count;
416 int val;
418 /* Set up structures we will need to add the protocol subtree and manage it */
419 proto_item *ti;
420 proto_tree *cast_tree = NULL;
421 proto_item *ti_sub;
422 proto_tree *cast_sub_tree;
423 proto_tree *cast_sub_tree_sav;
424 proto_tree *cast_sub_tree_sav_sav;
426 hdr_data_length = tvb_get_letohl(tvb, offset);
427 hdr_marker = tvb_get_letohl(tvb, offset+4);
428 data_messageid = tvb_get_letohl(tvb, offset+8);
430 /* In the interest of speed, if "tree" is NULL, don't do any work not
431 * necessary to generate protocol tree items. */
432 if (tree) {
433 ti = proto_tree_add_item(tree, proto_cast, tvb, offset, hdr_data_length+8, ENC_NA);
434 cast_tree = proto_item_add_subtree(ti, ett_cast);
435 proto_tree_add_uint(cast_tree, hf_cast_data_length, tvb, offset, 4, hdr_data_length);
436 proto_tree_add_uint(cast_tree, hf_cast_reserved, tvb, offset+4, 4, hdr_marker);
439 messageid_str = val_to_str(data_messageid, message_id, "0x%08X (Unknown)");
441 col_add_str(pinfo->cinfo, COL_INFO, messageid_str);
443 if (tree) {
444 proto_tree_add_uint(cast_tree, hf_cast_messageid, tvb,offset+8, 4, data_messageid );
447 if (tree) {
448 switch(data_messageid) {
450 case 0x0 : /* keepAlive */
451 /* no data in message */
452 break;
454 case 0x1 : /* KeepAliveVersion */
455 proto_tree_add_item(cast_tree, hf_cast_version, tvb, offset+12, 4, ENC_LITTLE_ENDIAN);
456 break;
458 case 0x2 : /* KeepAliveVersionAck */
459 proto_tree_add_item(cast_tree, hf_cast_version, tvb, offset+12, 4, ENC_LITTLE_ENDIAN);
460 break;
462 case 0x3 : /* UpdateCapabilities */
463 /* to do - this message is very large and will span multiple packets, it would be nice to someday */
464 /* find out a way to join the next packet and get the complete message to decode */
465 proto_tree_add_item(cast_tree, hf_cast_videoCapCount, tvb, offset+12, 4, ENC_LITTLE_ENDIAN);
466 proto_tree_add_item(cast_tree, hf_cast_dataCapCount, tvb, offset+16, 4, ENC_LITTLE_ENDIAN);
467 proto_tree_add_item(cast_tree, hf_cast_RTPPayloadFormat, tvb, offset+20, 4, ENC_LITTLE_ENDIAN);
468 proto_tree_add_item(cast_tree, hf_cast_customPictureFormatCount, tvb, offset+24, 4, ENC_LITTLE_ENDIAN);
469 count = offset+28;
470 /* total of 120 bytes */
471 for ( i = 0; i < MAX_CUSTOM_PICTURES; i++ ) {
472 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 20, "customPictureFormat[%d]", i);
473 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
474 proto_tree_add_item(cast_sub_tree, hf_cast_pictureWidth, tvb, count, 4, ENC_LITTLE_ENDIAN);
475 count+= 4;
476 proto_tree_add_item(cast_sub_tree, hf_cast_pictureHeight, tvb, count, 4, ENC_LITTLE_ENDIAN);
477 count+= 4;
478 proto_tree_add_item(cast_sub_tree, hf_cast_pixelAspectRatio, tvb, count, 4, ENC_LITTLE_ENDIAN);
479 count+= 4;
480 proto_tree_add_item(cast_sub_tree, hf_cast_clockConversionCode, tvb, count, 4, ENC_LITTLE_ENDIAN);
481 count+= 4;
482 proto_tree_add_item(cast_sub_tree, hf_cast_clockDivisor, tvb, count, 4, ENC_LITTLE_ENDIAN);
483 count+= 4;
485 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 8, "confResources");
486 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
487 proto_tree_add_item(cast_sub_tree, hf_cast_activeStreamsOnRegistration, tvb, count, 4, ENC_LITTLE_ENDIAN);
488 count+= 4;
489 proto_tree_add_item(cast_sub_tree, hf_cast_maxBW, tvb, count, 4, ENC_LITTLE_ENDIAN);
490 count+= 4;
491 proto_tree_add_item(cast_sub_tree, hf_cast_serviceResourceCount, tvb, count, 4, ENC_LITTLE_ENDIAN);
492 count+= 4;
493 cast_sub_tree_sav = cast_sub_tree;
494 /* total of 160 bytes */
495 for ( i = 0; i < MAX_SERVICE_TYPE; i++ ) {
496 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 20, "serviceResource[%d]", i);
497 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
498 proto_tree_add_item(cast_sub_tree, hf_cast_layoutCount, tvb, count, 4, ENC_LITTLE_ENDIAN);
499 count+= 4;
500 cast_sub_tree_sav_sav = cast_sub_tree_sav;
501 for ( t = 0; t < MAX_LAYOUT_WITH_SAME_SERVICE; t++ ) {
502 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 20, "layouts[%d]", t);
503 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
504 proto_tree_add_item(cast_sub_tree, hf_cast_layout, tvb, count, 4, ENC_LITTLE_ENDIAN);
505 count+= 4;
507 cast_sub_tree = cast_sub_tree_sav_sav;
508 proto_tree_add_item(cast_sub_tree, hf_cast_serviceNum, tvb, count, 4, ENC_LITTLE_ENDIAN);
509 count+= 4;
510 proto_tree_add_item(cast_sub_tree, hf_cast_maxStreams, tvb, count, 4, ENC_LITTLE_ENDIAN);
511 count+= 4;
512 proto_tree_add_item(cast_sub_tree, hf_cast_maxConferences, tvb, count, 4, ENC_LITTLE_ENDIAN);
513 count+= 4;
514 proto_tree_add_item(cast_sub_tree, hf_cast_activeConferenceOnRegistration, tvb, count, 4, ENC_LITTLE_ENDIAN);
515 count+= 4;
517 /* total of 176 bytes */
518 for ( i = 0; i < StationMaxVideoCapabilities; i++ ) {
519 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 20, "vidCaps[%d]", i);
520 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
521 proto_tree_add_item(cast_sub_tree, hf_cast_payloadCapability, tvb, count, 4, ENC_LITTLE_ENDIAN);
522 count+= 4;
523 proto_tree_add_item(cast_sub_tree, hf_cast_transmitOrReceive, tvb, count, 4, ENC_LITTLE_ENDIAN);
524 count+= 4;
525 proto_tree_add_item(cast_sub_tree, hf_cast_levelPreferenceCount, tvb, count, 4, ENC_LITTLE_ENDIAN);
526 count+= 4;
527 cast_sub_tree_sav = cast_sub_tree;
528 for ( t = 0; t < MAX_LEVEL_PREFERENCE; t++ ) {
529 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 20, "levelPreference[%d]", t);
530 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
531 proto_tree_add_item(cast_sub_tree, hf_cast_transmitPreference, tvb, count, 4, ENC_LITTLE_ENDIAN);
532 count+= 4;
533 proto_tree_add_item(cast_sub_tree, hf_cast_format, tvb, count, 4, ENC_LITTLE_ENDIAN);
534 count+= 4;
535 proto_tree_add_item(cast_sub_tree, hf_cast_maxBitRate, tvb, count, 4, ENC_LITTLE_ENDIAN);
536 count+= 4;
537 proto_tree_add_item(cast_sub_tree, hf_cast_minBitRate, tvb, count, 4, ENC_LITTLE_ENDIAN);
538 count+= 4;
539 proto_tree_add_item(cast_sub_tree, hf_cast_MPI, tvb, count, 4, ENC_LITTLE_ENDIAN);
540 count+= 4;
541 proto_tree_add_item(cast_sub_tree, hf_cast_serviceNumber, tvb, count, 4, ENC_LITTLE_ENDIAN);
542 count+= 4;
545 /* H.261 */
546 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8, "h261VideoCapability");
547 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
548 proto_tree_add_item(cast_sub_tree, hf_cast_temporalSpatialTradeOffCapability, tvb, count, 4, ENC_LITTLE_ENDIAN);
549 proto_tree_add_item(cast_sub_tree, hf_cast_stillImageTransmission, tvb, count+4, 4, ENC_LITTLE_ENDIAN);
551 /* H.263 */
552 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8, "h263VideoCapability");
553 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
554 proto_tree_add_item(cast_sub_tree, hf_cast_h263_capability_bitfield, tvb, count, 4, ENC_LITTLE_ENDIAN);
555 proto_tree_add_item(cast_sub_tree, hf_cast_annexNandWFutureUse, tvb, count+4, 4, ENC_LITTLE_ENDIAN);
557 /* Vieo */
558 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8, "vieoVideoCapability");
559 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
560 proto_tree_add_item(cast_sub_tree, hf_cast_modelNumber, tvb, count, 4, ENC_LITTLE_ENDIAN);
561 count+= 4;
562 proto_tree_add_item(cast_sub_tree, hf_cast_bandwidth, tvb, count, 4, ENC_LITTLE_ENDIAN);
563 count+= 4;
565 /* total 80 bytes */
566 for ( i = 0; i < StationMaxDataCapabilities; i++ ) {
567 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 20, "dataCaps[%d]", i);
568 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
569 proto_tree_add_item(cast_sub_tree, hf_cast_payloadCapability, tvb, count, 4, ENC_LITTLE_ENDIAN);
570 count+= 4;
571 proto_tree_add_item(cast_sub_tree, hf_cast_transmitOrReceive, tvb, count, 4, ENC_LITTLE_ENDIAN);
572 count+= 4;
573 proto_tree_add_item(cast_sub_tree, hf_cast_protocolDependentData, tvb, count, 4, ENC_LITTLE_ENDIAN);
574 count+= 4;
575 proto_tree_add_item(cast_sub_tree, hf_cast_maxBitRate, tvb, count, 4, ENC_LITTLE_ENDIAN);
576 count+= 4;
578 break;
580 case 0x4 : /* */
581 break;
583 case 0x5 : /* OpenMultiMediaReceiveChannel */
584 proto_tree_add_item(cast_tree, hf_cast_conferenceID, tvb, offset+12, 4, ENC_LITTLE_ENDIAN);
585 proto_tree_add_item(cast_tree, hf_cast_passThruPartyID, tvb, offset+16, 4, ENC_LITTLE_ENDIAN);
586 proto_tree_add_item(cast_tree, hf_cast_payloadCapability, tvb, offset+20, 4, ENC_LITTLE_ENDIAN);
587 proto_tree_add_item(cast_tree, hf_cast_lineInstance, tvb, offset+24, 4, ENC_LITTLE_ENDIAN);
588 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, offset+28, 4, ENC_LITTLE_ENDIAN);
589 proto_tree_add_item(cast_tree, hf_cast_payload_rfc_number, tvb, offset+32, 4, ENC_LITTLE_ENDIAN);
590 proto_tree_add_item(cast_tree, hf_cast_payloadType, tvb, offset+36, 4, ENC_LITTLE_ENDIAN);
591 proto_tree_add_item(cast_tree, hf_cast_isConferenceCreator, tvb, offset+40, 4, ENC_LITTLE_ENDIAN);
593 /* add audio part of union */
594 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 12, "audioParameters");
595 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
596 proto_tree_add_item(cast_sub_tree, hf_cast_millisecondPacketSize, tvb, offset+44, 4, ENC_LITTLE_ENDIAN);
597 proto_tree_add_item(cast_sub_tree, hf_cast_echoCancelType, tvb, offset+48, 4, ENC_LITTLE_ENDIAN);
598 proto_tree_add_item(cast_sub_tree, hf_cast_g723BitRate, tvb, offset+52, 4, ENC_LITTLE_ENDIAN);
600 /* add video part of union */
601 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 30, "videoParameters");
602 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
603 proto_tree_add_item(cast_sub_tree, hf_cast_bitRate, tvb, offset+44, 4, ENC_LITTLE_ENDIAN);
604 proto_tree_add_item(cast_sub_tree, hf_cast_pictureFormatCount, tvb, offset+48, 4, ENC_LITTLE_ENDIAN);
605 cast_sub_tree_sav = cast_sub_tree;
606 count = offset+52;
607 for ( i = 0; i < MAX_PICTURE_FORMAT; i++ ) {
608 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8 * MAX_PICTURE_FORMAT, "pictureFormat[%d]", i);
609 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
610 proto_tree_add_item(cast_sub_tree, hf_cast_format, tvb, count, 4, ENC_LITTLE_ENDIAN);
611 count += 4;
612 proto_tree_add_item(cast_sub_tree, hf_cast_MPI, tvb, count, 4, ENC_LITTLE_ENDIAN);
613 count += 4;
615 cast_sub_tree = cast_sub_tree_sav;
616 proto_tree_add_item(cast_sub_tree, hf_cast_confServiceNum, tvb, count, 4, ENC_LITTLE_ENDIAN);
617 count += 4;
619 /* add H261 part of union */
620 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8, "h261VideoCapability");
621 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
622 proto_tree_add_item(cast_sub_tree, hf_cast_temporalSpatialTradeOffCapability, tvb, count, 4, ENC_LITTLE_ENDIAN);
623 proto_tree_add_item(cast_sub_tree, hf_cast_stillImageTransmission, tvb, count+4, 4, ENC_LITTLE_ENDIAN);
625 /* add H263 part of union */
626 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8, "h263VideoCapability");
627 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
628 proto_tree_add_item(cast_sub_tree, hf_cast_h263_capability_bitfield, tvb, count, 4, ENC_LITTLE_ENDIAN);
629 proto_tree_add_item(cast_sub_tree, hf_cast_annexNandWFutureUse, tvb, count+4, 4, ENC_LITTLE_ENDIAN);
631 /* add Vieo part of union */
632 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8, "vieoVideoCapability");
633 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
634 proto_tree_add_item(cast_sub_tree, hf_cast_modelNumber, tvb, count, 4, ENC_LITTLE_ENDIAN);
635 count += 4;
636 proto_tree_add_item(cast_sub_tree, hf_cast_bandwidth, tvb, count, 4, ENC_LITTLE_ENDIAN);
638 /* add data part of union */
639 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 8, "dataParameters");
640 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
641 proto_tree_add_item(cast_sub_tree, hf_cast_protocolDependentData, tvb, offset+44, 4, ENC_LITTLE_ENDIAN);
642 proto_tree_add_item(cast_sub_tree, hf_cast_maxBitRate, tvb, offset+48, 4, ENC_LITTLE_ENDIAN);
643 break;
645 case 0x6 : /* OpenMultiMediaReceiveChannelACK */
646 proto_tree_add_item(cast_tree, hf_cast_ORCStatus, tvb, offset+12, 4, ENC_LITTLE_ENDIAN);
647 proto_tree_add_item(cast_tree, hf_cast_ipAddress, tvb, offset+16, 4, ENC_LITTLE_ENDIAN);
648 proto_tree_add_item(cast_tree, hf_cast_portNumber, tvb, offset+20, 4, ENC_LITTLE_ENDIAN);
649 proto_tree_add_item(cast_tree, hf_cast_passThruPartyID, tvb, offset+24, 4, ENC_LITTLE_ENDIAN);
650 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, offset+28, 4, ENC_LITTLE_ENDIAN);
651 break;
653 case 0x7 : /* CloseMultiMediaReceiveChannel */
654 proto_tree_add_item(cast_tree, hf_cast_conferenceID, tvb, offset+12, 4, ENC_LITTLE_ENDIAN);
655 proto_tree_add_item(cast_tree, hf_cast_passThruPartyID, tvb, offset+16, 4, ENC_LITTLE_ENDIAN);
656 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, offset+20, 4, ENC_LITTLE_ENDIAN);
657 break;
659 case 0x8 : /* StartMultiMediaTransmission */
660 proto_tree_add_item(cast_tree, hf_cast_conferenceID, tvb, offset+12, 4, ENC_LITTLE_ENDIAN);
661 proto_tree_add_item(cast_tree, hf_cast_passThruPartyID, tvb, offset+16, 4, ENC_LITTLE_ENDIAN);
662 proto_tree_add_item(cast_tree, hf_cast_payloadCapability, tvb, offset+20, 4, ENC_LITTLE_ENDIAN);
663 proto_tree_add_item(cast_tree, hf_cast_ipAddress, tvb, offset+24, 4, ENC_LITTLE_ENDIAN);
664 proto_tree_add_item(cast_tree, hf_cast_portNumber, tvb, offset+28, 4, ENC_LITTLE_ENDIAN);
665 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, offset+32, 4, ENC_LITTLE_ENDIAN);
666 proto_tree_add_item(cast_tree, hf_cast_payload_rfc_number, tvb, offset+36, 4, ENC_LITTLE_ENDIAN);
667 proto_tree_add_item(cast_tree, hf_cast_payloadType, tvb, offset+40, 4, ENC_LITTLE_ENDIAN);
668 proto_tree_add_item(cast_tree, hf_cast_DSCPValue, tvb, offset+44, 4, ENC_LITTLE_ENDIAN);
670 /* add video part of union */
671 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 30, "videoParameters");
672 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
673 proto_tree_add_item(cast_sub_tree, hf_cast_bitRate, tvb, offset+48, 4, ENC_LITTLE_ENDIAN);
674 proto_tree_add_item(cast_sub_tree, hf_cast_pictureFormatCount, tvb, offset+52, 4, ENC_LITTLE_ENDIAN);
675 cast_sub_tree_sav = cast_sub_tree;
676 count = offset+56;
677 for ( i = 0; i < MAX_PICTURE_FORMAT; i++ ) {
678 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8 * MAX_PICTURE_FORMAT, "pictureFormat[%d]", i);
679 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
680 proto_tree_add_item(cast_sub_tree, hf_cast_format, tvb, count, 4, ENC_LITTLE_ENDIAN);
681 count += 4;
682 proto_tree_add_item(cast_sub_tree, hf_cast_MPI, tvb, count, 4, ENC_LITTLE_ENDIAN);
683 count += 4;
685 cast_sub_tree = cast_sub_tree_sav;
686 proto_tree_add_item(cast_sub_tree, hf_cast_confServiceNum, tvb, count, 4, ENC_LITTLE_ENDIAN);
687 count += 4;
689 val = count;
690 /* add H261 part of union */
691 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8, "h261VideoCapability");
692 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
693 proto_tree_add_item(cast_sub_tree, hf_cast_temporalSpatialTradeOffCapability, tvb, count, 4, ENC_LITTLE_ENDIAN);
694 count += 4;
695 proto_tree_add_item(cast_sub_tree, hf_cast_stillImageTransmission, tvb, count, 4, ENC_LITTLE_ENDIAN);
697 /* add H263 part of union */
698 count = val;
699 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8, "h263VideoCapability");
700 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
701 proto_tree_add_item(cast_sub_tree, hf_cast_h263_capability_bitfield, tvb, count, 4, ENC_LITTLE_ENDIAN);
702 count += 4;
703 proto_tree_add_item(cast_sub_tree, hf_cast_annexNandWFutureUse, tvb, count, 4, ENC_LITTLE_ENDIAN);
705 /* add Vieo part of union */
706 count = val;
707 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8, "vieoVideoCapability");
708 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
709 proto_tree_add_item(cast_sub_tree, hf_cast_modelNumber, tvb, count, 4, ENC_LITTLE_ENDIAN);
710 count += 4;
711 proto_tree_add_item(cast_sub_tree, hf_cast_bandwidth, tvb, count, 4, ENC_LITTLE_ENDIAN);
713 /* add data part of union */
714 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 8, "dataParameters");
715 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
716 proto_tree_add_item(cast_sub_tree, hf_cast_protocolDependentData, tvb, offset+48, 4, ENC_LITTLE_ENDIAN);
717 proto_tree_add_item(cast_sub_tree, hf_cast_maxBitRate, tvb, offset+52, 4, ENC_LITTLE_ENDIAN);
718 break;
720 case 0x9 : /* StopMultiMediaTransmission */
721 proto_tree_add_item(cast_tree, hf_cast_conferenceID, tvb, offset+12, 4, ENC_LITTLE_ENDIAN);
722 proto_tree_add_item(cast_tree, hf_cast_passThruPartyID, tvb, offset+16, 4, ENC_LITTLE_ENDIAN);
723 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, offset+20, 4, ENC_LITTLE_ENDIAN);
724 break;
726 case 0xA : /* MiscellaneousCommand */
727 proto_tree_add_item(cast_tree, hf_cast_conferenceID, tvb, offset+12, 4, ENC_LITTLE_ENDIAN);
728 proto_tree_add_item(cast_tree, hf_cast_passThruPartyID, tvb, offset+16, 4, ENC_LITTLE_ENDIAN);
729 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, offset+20, 4, ENC_LITTLE_ENDIAN);
730 proto_tree_add_item(cast_tree, hf_cast_miscCommandType, tvb, offset+24, 4, ENC_LITTLE_ENDIAN);
732 /* show videoFreezePicture */
733 /* not sure of format */
735 /* show videoFastUpdatePicture */
736 /* not sure of format */
738 /* show videoFastUpdateGOB */
739 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 8, "videoFastUpdateGOB");
740 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
741 proto_tree_add_item(cast_sub_tree, hf_cast_firstGOB, tvb, offset+28, 4, ENC_LITTLE_ENDIAN);
742 proto_tree_add_item(cast_sub_tree, hf_cast_numberOfGOBs, tvb, offset+32, 4, ENC_LITTLE_ENDIAN);
744 /* show videoFastUpdateMB */
745 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 8, "videoFastUpdateGOB");
746 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
747 proto_tree_add_item(cast_sub_tree, hf_cast_firstGOB, tvb, offset+28, 4, ENC_LITTLE_ENDIAN);
748 proto_tree_add_item(cast_sub_tree, hf_cast_firstMB, tvb, offset+32, 4, ENC_LITTLE_ENDIAN);
749 proto_tree_add_item(cast_sub_tree, hf_cast_numberOfMBs, tvb, offset+36, 4, ENC_LITTLE_ENDIAN);
751 /* show lostPicture */
752 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 8, "lostPicture");
753 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
754 proto_tree_add_item(cast_sub_tree, hf_cast_pictureNumber, tvb, offset+28, 4, ENC_LITTLE_ENDIAN);
755 proto_tree_add_item(cast_sub_tree, hf_cast_longTermPictureIndex, tvb, offset+32, 4, ENC_LITTLE_ENDIAN);
757 /* show lostPartialPicture */
758 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 8, "lostPartialPicture");
759 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
760 proto_tree_add_item(cast_sub_tree, hf_cast_pictureNumber, tvb, offset+28, 4, ENC_LITTLE_ENDIAN);
761 proto_tree_add_item(cast_sub_tree, hf_cast_longTermPictureIndex, tvb, offset+32, 4, ENC_LITTLE_ENDIAN);
762 proto_tree_add_item(cast_sub_tree, hf_cast_firstMB, tvb, offset+36, 4, ENC_LITTLE_ENDIAN);
763 proto_tree_add_item(cast_sub_tree, hf_cast_numberOfMBs, tvb, offset+40, 4, ENC_LITTLE_ENDIAN);
765 /* show recoveryReferencePicture */
766 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 8, "recoveryReferencePicture");
767 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
768 proto_tree_add_item(cast_sub_tree, hf_cast_recoveryReferencePictureCount, tvb, offset+28, 4, ENC_LITTLE_ENDIAN);
769 cast_sub_tree_sav = cast_sub_tree;
770 for ( i = 0; i < MAX_REFERENCE_PICTURE; i++ ) {
771 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8, "recoveryReferencePicture[%d]", i);
772 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
773 proto_tree_add_item(cast_sub_tree, hf_cast_pictureNumber, tvb, offset+32+(i*8), 4, ENC_LITTLE_ENDIAN);
774 proto_tree_add_item(cast_sub_tree, hf_cast_longTermPictureIndex, tvb, offset+36+(i*8), 4, ENC_LITTLE_ENDIAN);
777 /* show temporalSpatialTradeOff */
778 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 4, "temporalSpatialTradeOff");
779 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
780 proto_tree_add_item(cast_sub_tree, hf_cast_temporalSpatialTradeOff, tvb, offset+28, 4, ENC_LITTLE_ENDIAN);
781 break;
783 case 0xB : /* FlowControlCommand */
784 proto_tree_add_item(cast_tree, hf_cast_conferenceID, tvb, offset+12, 4, ENC_LITTLE_ENDIAN);
785 proto_tree_add_item(cast_tree, hf_cast_passThruPartyID, tvb, offset+16, 4, ENC_LITTLE_ENDIAN);
786 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, offset+20, 4, ENC_LITTLE_ENDIAN);
787 proto_tree_add_item(cast_tree, hf_cast_maxBitRate, tvb, offset+24, 4, ENC_LITTLE_ENDIAN);
788 break;
790 case 0xC : /* ClearConference */
791 proto_tree_add_item(cast_tree, hf_cast_conferenceID, tvb, offset+12, 4, ENC_LITTLE_ENDIAN);
792 proto_tree_add_item(cast_tree, hf_cast_serviceNum, tvb, offset+16, 4, ENC_LITTLE_ENDIAN);
793 break;
795 case 0xD : /* CallState */
796 proto_tree_add_item(cast_tree, hf_cast_callState, tvb, offset+12, 4, ENC_LITTLE_ENDIAN);
797 proto_tree_add_item(cast_tree, hf_cast_lineInstance, tvb, offset+16, 4, ENC_LITTLE_ENDIAN);
798 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, offset+20, 4, ENC_LITTLE_ENDIAN);
799 proto_tree_add_item(cast_tree, hf_cast_privacy, tvb, offset+24, 4, ENC_LITTLE_ENDIAN);
800 proto_tree_add_item(cast_tree, hf_cast_precedenceLv, tvb, offset+28, 4, ENC_LITTLE_ENDIAN);
801 proto_tree_add_item(cast_tree, hf_cast_precedenceDm, tvb, offset+32, 4, ENC_LITTLE_ENDIAN);
802 break;
804 case 0xE : /* RequestCallState */
805 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, offset+12, 4, ENC_LITTLE_ENDIAN);
806 break;
808 case 0xF : /* RequestAllCallStates */
809 /* no data in message */
810 break;
812 case 0x10 : /* CallInfo */
813 i = offset+12;
814 proto_tree_add_item(cast_tree, hf_cast_callingPartyName, tvb, i, StationMaxNameSize, ENC_ASCII|ENC_NA);
815 i += StationMaxNameSize;
816 proto_tree_add_item(cast_tree, hf_cast_callingParty, tvb, i, StationMaxDirnumSize, ENC_ASCII|ENC_NA);
817 i += StationMaxDirnumSize;
818 proto_tree_add_item(cast_tree, hf_cast_calledPartyName, tvb, i, StationMaxNameSize, ENC_ASCII|ENC_NA);
819 i += StationMaxNameSize;
820 proto_tree_add_item(cast_tree, hf_cast_calledParty, tvb, i, StationMaxDirnumSize, ENC_ASCII|ENC_NA);
821 i += StationMaxDirnumSize;
822 proto_tree_add_item(cast_tree, hf_cast_lineInstance, tvb, i, 4, ENC_LITTLE_ENDIAN);
823 i += 4;
824 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, i, 4, ENC_LITTLE_ENDIAN);
825 i += 4;
826 proto_tree_add_item(cast_tree, hf_cast_callType, tvb, i, 4, ENC_LITTLE_ENDIAN);
827 i += 4;
828 proto_tree_add_item(cast_tree, hf_cast_originalCalledPartyName, tvb, i, StationMaxNameSize, ENC_ASCII|ENC_NA);
829 i += StationMaxNameSize;
830 proto_tree_add_item(cast_tree, hf_cast_originalCalledParty, tvb, i, StationMaxDirnumSize, ENC_ASCII|ENC_NA);
831 i += StationMaxDirnumSize;
832 proto_tree_add_item(cast_tree, hf_cast_lastRedirectingPartyName, tvb, i, StationMaxNameSize, ENC_ASCII|ENC_NA);
833 i += StationMaxNameSize;
834 proto_tree_add_item(cast_tree, hf_cast_lastRedirectingParty, tvb, i, StationMaxDirnumSize, ENC_ASCII|ENC_NA);
835 i += StationMaxDirnumSize;
836 proto_tree_add_item(cast_tree, hf_cast_originalCdpnRedirectReason, tvb, i, 4, ENC_LITTLE_ENDIAN);
837 i += 4;
838 proto_tree_add_item(cast_tree, hf_cast_lastRedirectingReason, tvb, i, 4, ENC_LITTLE_ENDIAN);
839 i += 4;
840 proto_tree_add_item(cast_tree, hf_cast_cgpnVoiceMailbox, tvb, i, StationMaxDirnumSize, ENC_ASCII|ENC_NA);
841 i += StationMaxDirnumSize;
842 proto_tree_add_item(cast_tree, hf_cast_cdpnVoiceMailbox, tvb, i, StationMaxDirnumSize, ENC_ASCII|ENC_NA);
843 i += StationMaxDirnumSize;
844 proto_tree_add_item(cast_tree, hf_cast_originalCdpnVoiceMailbox, tvb, i, StationMaxDirnumSize, ENC_ASCII|ENC_NA);
845 i += StationMaxDirnumSize;
846 proto_tree_add_item(cast_tree, hf_cast_lastRedirectingVoiceMailbox, tvb, i, StationMaxDirnumSize, ENC_ASCII|ENC_NA);
847 i += StationMaxDirnumSize;
848 proto_tree_add_item(cast_tree, hf_cast_callInstance, tvb, i, 4, ENC_LITTLE_ENDIAN);
849 i += 4;
850 proto_tree_add_item(cast_tree, hf_cast_callSecurityStatus, tvb, i, 4, ENC_LITTLE_ENDIAN);
851 i += 4;
852 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 8, "partyPIRestrictionBits");
853 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
854 proto_tree_add_item(cast_sub_tree, hf_cast_partyPIRestrictionBits_CallingPartyName, tvb, i, 4, ENC_LITTLE_ENDIAN);
855 proto_tree_add_item(cast_sub_tree, hf_cast_partyPIRestrictionBits_CallingPartyNumber, tvb, i, 4, ENC_LITTLE_ENDIAN);
856 proto_tree_add_item(cast_sub_tree, hf_cast_partyPIRestrictionBits_CalledPartyName, tvb, i, 4, ENC_LITTLE_ENDIAN);
857 proto_tree_add_item(cast_sub_tree, hf_cast_partyPIRestrictionBits_CalledPartyNumber, tvb, i, 4, ENC_LITTLE_ENDIAN);
858 proto_tree_add_item(cast_sub_tree, hf_cast_partyPIRestrictionBits_OriginalCalledPartyName, tvb, i, 4, ENC_LITTLE_ENDIAN);
859 proto_tree_add_item(cast_sub_tree, hf_cast_partyPIRestrictionBits_OriginalCalledPartyNumber, tvb, i, 4, ENC_LITTLE_ENDIAN);
860 proto_tree_add_item(cast_sub_tree, hf_cast_partyPIRestrictionBits_LastRedirectPartyName, tvb, i, 4, ENC_LITTLE_ENDIAN);
861 proto_tree_add_item(cast_sub_tree, hf_cast_partyPIRestrictionBits_LastRedirectPartyNumber, tvb, i, 4, ENC_LITTLE_ENDIAN);
862 break;
864 case 0x11 : /* RequestCallInfo */
865 proto_tree_add_item(cast_tree, hf_cast_lineInstance, tvb, offset+12, 4, ENC_LITTLE_ENDIAN);
866 break;
868 case 0x12 : /* CallFocus */
869 proto_tree_add_item(cast_tree, hf_cast_lineInstance, tvb, offset+12, 4, ENC_LITTLE_ENDIAN);
870 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, offset+16, 4, ENC_LITTLE_ENDIAN);
871 break;
873 case 0x13 : /* MakeCall */
874 proto_tree_add_item(cast_tree, hf_cast_calledParty, tvb, offset+12, StationMaxDirnumSize, ENC_ASCII|ENC_NA);
875 proto_tree_add_item(cast_tree, hf_cast_lineInstance, tvb, offset+16, 4, ENC_LITTLE_ENDIAN);
876 break;
878 case 0x14 : /* HangUp */
879 proto_tree_add_item(cast_tree, hf_cast_lineInstance, tvb, offset+12, 4, ENC_LITTLE_ENDIAN);
880 break;
882 case 0x15 : /* Answer */
883 proto_tree_add_item(cast_tree, hf_cast_lineInstance, tvb, offset+12, 4, ENC_LITTLE_ENDIAN);
884 break;
886 case 0x40 : /* keepAliveAck */
887 /* no data in message */
888 break;
890 case 0x41 : /* StreamStart */
891 /* no data in message */
892 break;
894 case 0x42 : /* StreamStop */
895 /* no data in message */
896 break;
898 case 0x43 : /* MuteStart */
899 /* no data in message */
900 break;
902 case 0x44 : /* MuteStop */
903 /* no data in message */
904 break;
906 case 0x45 : /* SpeakerStart */
907 /* no data in message */
908 break;
910 case 0x46 : /* SpeakerStop */
911 /* no data in message */
912 break;
914 case 0x47 : /* StreamStartMessageWithCodec */
915 proto_tree_add_item(cast_tree, hf_cast_audio, tvb, offset+12, 4, ENC_LITTLE_ENDIAN);
916 break;
919 case 0x50 : /* VIEODiscoveryprotocol */
920 break;
922 case 0x51 : /* VIEOControlprotocol */
923 break;
926 case 0x60 : /* VeT120protocol */
927 break;
929 case 0x61 : /* VeT121protocol */
930 break;
932 case 0x62 : /* VeT122protocol */
933 break;
936 case 0x70 : /* IMSessionDiscoveryprotocol */
937 break;
939 case 0x71 : /* IMSessionControlprotocol */
940 break;
943 case 0x74 : /* SlidesDiscoveryprotocol */
944 break;
946 case 0x75 : /* SlidesControlprotocol */
947 break;
950 case 0x80 : /* Tunnel */
951 break;
953 case 0x90 : /* RemoteInfoRequest */
954 i = offset+12;
955 proto_tree_add_item(cast_tree, hf_cast_stationFriendlyName, tvb, i, StationMaxNameSize, ENC_ASCII|ENC_NA);
956 i += StationMaxNameSize;
957 proto_tree_add_item(cast_tree, hf_cast_stationGUID, tvb, i, StationMaxNameSize, ENC_ASCII|ENC_NA);
958 i += StationMaxNameSize;
959 proto_tree_add_item(cast_tree, hf_cast_requestorIpAddress, tvb, i, 4, ENC_LITTLE_ENDIAN);
960 break;
962 case 0x91 : /* RemoteInfoResponse */
963 i = offset+12;
964 proto_tree_add_item(cast_tree, hf_cast_stationFriendlyName, tvb, i, StationMaxNameSize, ENC_ASCII|ENC_NA);
965 i += StationMaxNameSize;
966 proto_tree_add_item(cast_tree, hf_cast_stationGUID, tvb, i, StationMaxNameSize, ENC_ASCII|ENC_NA);
967 i += StationMaxNameSize;
968 proto_tree_add_item(cast_tree, hf_cast_stationIpAddress, tvb, i, 4, ENC_LITTLE_ENDIAN);
969 i += 4;
970 proto_tree_add_item(cast_tree, hf_cast_directoryNumber, tvb, i, StationMaxNameSize, ENC_ASCII|ENC_NA);
971 break;
974 case 0xA0 : /* CollabDiscoveryprotocol */
975 break;
977 case 0xA1 : /* CollabControlprotocol */
978 break;
981 case 0xA4 : /* FECCDiscoveryprotocol */
982 break;
984 case 0xA5 : /* FECCControlprotocol */
985 break;
988 case 0xB0 : /* ClockSyncprotocol */
989 break;
991 case 0xB1 : /* StreamSyncprotocol */
992 break;
995 case 0xB4 : /* MediaDiscoveryprotocol */
996 break;
998 case 0xB5 : /* MediaControlprotocol */
999 break;
1002 case 0xC0 : /* SessionDiscoveryprotocol */
1003 break;
1005 case 0xC1 : /* SessionControlprotocol */
1006 break;
1009 case 0xC4 : /* ConferenceDiscoveryprotocol */
1010 break;
1012 case 0xC5 : /* Conferenceprotocol */
1013 break;
1016 case 0xCC : /* SCCPCallControlProxyprotocol */
1017 break;
1020 case 0xD0 : /* CallDiscoveryprotocol */
1021 break;
1023 case 0xD1 : /* CallControlprotocol */
1024 break;
1027 default:
1028 break;
1032 return tvb_length(tvb);
1035 /* Get the length of a single CAST PDU */
1036 static guint
1037 get_cast_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
1039 guint32 hdr_data_length;
1042 * Get the length of the CAST packet.
1044 hdr_data_length = tvb_get_letohl(tvb, offset);
1047 * That length doesn't include the length of the header itself;
1048 * add that in.
1050 return hdr_data_length + 8;
1053 /* Code to actually dissect the packets */
1054 static int
1055 dissect_cast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
1057 /* The general structure of a packet: {IP-Header|TCP-Header|n*CAST}
1058 * CAST-Packet: {Header(Size, Reserved)|Data(MessageID, Message-Data)}
1060 /* Header fields */
1061 volatile guint32 hdr_data_length;
1062 guint32 hdr_marker;
1064 /* check, if this is really an SKINNY packet, they start with a length + 0 */
1066 /* get relevant header information */
1067 hdr_data_length = tvb_get_letohl(tvb, 0);
1068 hdr_marker = tvb_get_letohl(tvb, 4);
1070 /* data_size = MIN(8+hdr_data_length, tvb_length(tvb)) - 0xC; */
1072 if (hdr_data_length < 4 || hdr_marker != 0) {
1073 return 0;
1076 /* Make entries in Protocol column and Info column on summary display */
1077 col_set_str(pinfo->cinfo, COL_PROTOCOL, "CAST");
1079 col_set_str(pinfo->cinfo, COL_INFO, "Cast Client Control Protocol");
1080 tcp_dissect_pdus(tvb, pinfo, tree, cast_desegment, 4, get_cast_pdu_len, dissect_cast_pdu, data);
1081 return tvb_length(tvb);
1084 /* Register the protocol with Wireshark */
1085 void
1086 proto_register_cast(void)
1088 /* Setup list of header fields */
1089 static hf_register_info hf[] = {
1090 { &hf_cast_data_length,
1091 { "Data Length", "cast.data_length",
1092 FT_UINT32, BASE_DEC, NULL, 0x0,
1093 "Number of bytes in the data portion.",
1094 HFILL }
1097 { &hf_cast_reserved,
1098 { "Marker", "cast.marker",
1099 FT_UINT32, BASE_HEX, NULL, 0x0,
1100 "Marker value should ne zero.",
1101 HFILL }
1104 /* FIXME: Enable use of message name ??? */
1105 { &hf_cast_messageid,
1106 { "Message ID", "cast.messageid",
1107 FT_UINT32, BASE_HEX, VALS(message_id), 0x0,
1108 "The function requested/done with this message.",
1109 HFILL }
1112 { &hf_cast_version,
1113 { "Version", "cast.version",
1114 FT_UINT32, BASE_DEC, NULL, 0x0,
1115 "The version in the keepalive version messages.",
1116 HFILL }
1119 { &hf_cast_ORCStatus,
1120 { "ORCStatus", "cast.ORCStatus",
1121 FT_UINT32, BASE_DEC, VALS(orcStatus), 0x0,
1122 "The status of the opened receive channel.",
1123 HFILL }
1126 { &hf_cast_ipAddress,
1127 { "IP Address", "cast.ipAddress",
1128 FT_IPv4, BASE_NONE, NULL, 0x0,
1129 NULL, HFILL }
1132 { &hf_cast_portNumber,
1133 { "Port Number", "cast.portNumber",
1134 FT_UINT32, BASE_DEC, NULL, 0x0,
1135 NULL, HFILL }
1138 { &hf_cast_passThruPartyID,
1139 { "PassThruPartyID", "cast.passThruPartyID",
1140 FT_UINT32, BASE_DEC, NULL, 0x0,
1141 NULL, HFILL }
1144 { &hf_cast_callIdentifier,
1145 { "Call Identifier", "cast.callIdentifier",
1146 FT_UINT32, BASE_DEC, NULL, 0x0,
1147 "Call identifier for this call.",
1148 HFILL }
1151 { &hf_cast_conferenceID,
1152 { "Conference ID", "cast.conferenceID",
1153 FT_UINT32, BASE_DEC, NULL, 0x0,
1154 NULL, HFILL }
1157 { &hf_cast_payloadType,
1158 { "PayloadType", "cast.payloadType",
1159 FT_UINT32, BASE_DEC, NULL, 0x0,
1160 NULL, HFILL }
1163 { &hf_cast_lineInstance,
1164 { "Line Instance", "cast.lineInstance",
1165 FT_UINT32, BASE_DEC, NULL, 0x0,
1166 "The display call plane associated with this call.",
1167 HFILL }
1170 { &hf_cast_payloadCapability,
1171 { "PayloadCapability", "cast.payloadCapability",
1172 FT_UINT32, BASE_DEC, VALS(mediaPayloads), 0x0,
1173 "The payload capability for this media capability structure.",
1174 HFILL }
1177 { &hf_cast_isConferenceCreator,
1178 { "IsConferenceCreator", "cast.isConferenceCreator",
1179 FT_UINT32, BASE_DEC, NULL, 0x0,
1180 NULL, HFILL }
1183 { &hf_cast_payload_rfc_number,
1184 { "Payload_rfc_number", "cast.payload_rfc_number",
1185 FT_UINT32, BASE_DEC, NULL, 0x0,
1186 NULL, HFILL }
1189 { &hf_cast_videoCapCount,
1190 { "VideoCapCount", "cast.videoCapCount",
1191 FT_UINT32, BASE_DEC, NULL, 0x0,
1192 NULL, HFILL }
1195 { &hf_cast_dataCapCount,
1196 { "DataCapCount", "cast.dataCapCount",
1197 FT_UINT32, BASE_DEC, NULL, 0x0,
1198 NULL, HFILL }
1201 { &hf_cast_RTPPayloadFormat,
1202 { "RTPPayloadFormat", "cast.RTPPayloadFormat",
1203 FT_UINT32, BASE_DEC, NULL, 0x0,
1204 NULL, HFILL }
1207 { &hf_cast_customPictureFormatCount,
1208 { "CustomPictureFormatCount", "cast.customPictureFormatCount",
1209 FT_UINT32, BASE_DEC, NULL, 0x0,
1210 NULL, HFILL }
1213 { &hf_cast_pictureWidth,
1214 { "PictureWidth", "cast.pictureWidth",
1215 FT_UINT32, BASE_DEC, NULL, 0x0,
1216 NULL, HFILL }
1219 { &hf_cast_pictureHeight,
1220 { "PictureHeight", "cast.pictureHeight",
1221 FT_UINT32, BASE_DEC, NULL, 0x0,
1222 NULL, HFILL }
1225 { &hf_cast_pixelAspectRatio,
1226 { "PixelAspectRatio", "cast.pixelAspectRatio",
1227 FT_UINT32, BASE_DEC, NULL, 0x0,
1228 NULL, HFILL }
1231 { &hf_cast_clockConversionCode,
1232 { "ClockConversionCode", "cast.clockConversionCode",
1233 FT_UINT32, BASE_DEC, NULL, 0x0,
1234 NULL, HFILL }
1237 { &hf_cast_clockDivisor,
1238 { "ClockDivisor", "cast.clockDivisor",
1239 FT_UINT32, BASE_DEC, NULL, 0x0,
1240 NULL, HFILL }
1243 { &hf_cast_activeStreamsOnRegistration,
1244 { "ActiveStreamsOnRegistration", "cast.activeStreamsOnRegistration",
1245 FT_UINT32, BASE_DEC, NULL, 0x0,
1246 NULL, HFILL }
1249 { &hf_cast_maxBW,
1250 { "MaxBW", "cast.maxBW",
1251 FT_UINT32, BASE_DEC, NULL, 0x0,
1252 NULL, HFILL }
1255 { &hf_cast_serviceResourceCount,
1256 { "ServiceResourceCount", "cast.serviceResourceCount",
1257 FT_UINT32, BASE_DEC, NULL, 0x0,
1258 NULL, HFILL }
1261 { &hf_cast_layoutCount,
1262 { "LayoutCount", "cast.layoutCount",
1263 FT_UINT32, BASE_DEC, NULL, 0x0,
1264 NULL, HFILL }
1267 { &hf_cast_layout,
1268 { "Layout", "cast.layout",
1269 FT_UINT32, BASE_DEC, VALS(cast_Layouts), 0x0,
1270 NULL, HFILL }
1273 { &hf_cast_maxConferences,
1274 { "MaxConferences", "cast.maxConferences",
1275 FT_UINT32, BASE_DEC, NULL, 0x0,
1276 NULL, HFILL }
1279 { &hf_cast_activeConferenceOnRegistration,
1280 { "ActiveConferenceOnRegistration", "cast.activeConferenceOnRegistration",
1281 FT_UINT32, BASE_DEC, NULL, 0x0,
1282 NULL, HFILL }
1285 { &hf_cast_transmitOrReceive,
1286 { "TransmitOrReceive", "cast.transmitOrReceive",
1287 FT_UINT32, BASE_DEC, VALS(cast_transmitOrReceive), 0x0,
1288 NULL, HFILL }
1291 { &hf_cast_levelPreferenceCount,
1292 { "LevelPreferenceCount", "cast.levelPreferenceCount",
1293 FT_UINT32, BASE_DEC, NULL, 0x0,
1294 NULL, HFILL }
1297 { &hf_cast_transmitPreference,
1298 { "TransmitPreference", "cast.transmitPreference",
1299 FT_UINT32, BASE_DEC, NULL, 0x0,
1300 NULL, HFILL }
1303 { &hf_cast_format,
1304 { "Format", "cast.format",
1305 FT_UINT32, BASE_DEC, VALS(cast_formatTypes), 0x0,
1306 NULL, HFILL }
1309 { &hf_cast_maxBitRate,
1310 { "MaxBitRate", "cast.maxBitRate",
1311 FT_UINT32, BASE_DEC, NULL, 0x0,
1312 NULL, HFILL }
1315 { &hf_cast_minBitRate,
1316 { "MinBitRate", "cast.minBitRate",
1317 FT_UINT32, BASE_DEC, NULL, 0x0,
1318 NULL, HFILL }
1321 { &hf_cast_MPI,
1322 { "MPI", "cast.MPI",
1323 FT_UINT32, BASE_DEC, NULL, 0x0,
1324 NULL, HFILL }
1327 { &hf_cast_serviceNumber,
1328 { "ServiceNumber", "cast.serviceNumber",
1329 FT_UINT32, BASE_DEC, NULL, 0x0,
1330 NULL, HFILL }
1333 { &hf_cast_temporalSpatialTradeOffCapability,
1334 { "TemporalSpatialTradeOffCapability", "cast.temporalSpatialTradeOffCapability",
1335 FT_UINT32, BASE_DEC, NULL, 0x0,
1336 NULL, HFILL }
1339 { &hf_cast_stillImageTransmission,
1340 { "StillImageTransmission", "cast.stillImageTransmission",
1341 FT_UINT32, BASE_DEC, NULL, 0x0,
1342 NULL, HFILL }
1345 { &hf_cast_h263_capability_bitfield,
1346 { "H263_capability_bitfield", "cast.h263_capability_bitfield",
1347 FT_UINT32, BASE_DEC, NULL, 0x0,
1348 NULL, HFILL }
1351 { &hf_cast_annexNandWFutureUse,
1352 { "AnnexNandWFutureUse", "cast.annexNandWFutureUse",
1353 FT_UINT32, BASE_DEC, NULL, 0x0,
1354 NULL, HFILL }
1357 { &hf_cast_modelNumber,
1358 { "ModelNumber", "cast.modelNumber",
1359 FT_UINT32, BASE_DEC, NULL, 0x0,
1360 NULL, HFILL }
1363 { &hf_cast_bandwidth,
1364 { "Bandwidth", "cast.bandwidth",
1365 FT_UINT32, BASE_DEC, NULL, 0x0,
1366 NULL, HFILL }
1369 { &hf_cast_protocolDependentData,
1370 { "ProtocolDependentData", "cast.protocolDependentData",
1371 FT_UINT32, BASE_DEC, NULL, 0x0,
1372 NULL, HFILL }
1375 { &hf_cast_DSCPValue,
1376 { "DSCPValue", "cast.DSCPValue",
1377 FT_UINT32, BASE_DEC, NULL, 0x0,
1378 NULL, HFILL }
1381 { &hf_cast_serviceNum,
1382 { "ServiceNum", "cast.serviceNum",
1383 FT_UINT32, BASE_DEC, NULL, 0x0,
1384 NULL, HFILL }
1387 #if 0
1388 { &hf_cast_precedenceValue,
1389 { "Precedence", "cast.precedenceValue",
1390 FT_UINT32, BASE_DEC, NULL, 0x0,
1391 NULL, HFILL }
1393 #endif
1395 { &hf_cast_maxStreams,
1396 { "MaxStreams", "cast.maxStreams",
1397 FT_UINT32, BASE_DEC, NULL, 0x0,
1398 "32 bit unsigned integer indicating the maximum number of simultansous RTP duplex streams that the client can handle.",
1399 HFILL }
1402 { &hf_cast_millisecondPacketSize,
1403 { "MS/Packet", "cast.millisecondPacketSize",
1404 FT_UINT32, BASE_DEC, NULL, 0x0,
1405 "The number of milliseconds of conversation in each packet",
1406 HFILL }
1409 { &hf_cast_echoCancelType,
1410 { "Echo Cancel Type", "cast.echoCancelType",
1411 FT_UINT32, BASE_DEC, VALS(cast_echoCancelTypes), 0x0,
1412 "Is echo cancelling enabled or not",
1413 HFILL }
1416 { &hf_cast_g723BitRate,
1417 { "G723 BitRate", "cast.g723BitRate",
1418 FT_UINT32, BASE_DEC, VALS(cast_g723BitRates), 0x0,
1419 "The G723 bit rate for this stream/JUNK if not g723 stream",
1420 HFILL }
1423 { &hf_cast_pictureFormatCount,
1424 { "PictureFormatCount", "cast.pictureFormatCount",
1425 FT_UINT32, BASE_DEC, NULL, 0x0,
1426 NULL, HFILL }
1429 { &hf_cast_confServiceNum,
1430 { "ConfServiceNum", "cast.confServiceNum",
1431 FT_UINT32, BASE_DEC, NULL, 0x0,
1432 NULL, HFILL }
1435 { &hf_cast_miscCommandType,
1436 { "MiscCommandType", "cast.miscCommandType",
1437 FT_UINT32, BASE_DEC, VALS(cast_miscCommandType), 0x0,
1438 NULL, HFILL }
1441 { &hf_cast_temporalSpatialTradeOff,
1442 { "TemporalSpatialTradeOff", "cast.temporalSpatialTradeOff",
1443 FT_UINT32, BASE_DEC, NULL, 0x0,
1444 NULL, HFILL }
1447 { &hf_cast_firstGOB,
1448 { "FirstGOB", "cast.firstGOB",
1449 FT_UINT32, BASE_DEC, NULL, 0x0,
1450 NULL, HFILL }
1453 { &hf_cast_numberOfGOBs,
1454 { "NumberOfGOBs", "cast.numberOfGOBs",
1455 FT_UINT32, BASE_DEC, NULL, 0x0,
1456 NULL, HFILL }
1459 { &hf_cast_firstMB,
1460 { "FirstMB", "cast.firstMB",
1461 FT_UINT32, BASE_DEC, NULL, 0x0,
1462 NULL, HFILL }
1465 { &hf_cast_numberOfMBs,
1466 { "NumberOfMBs", "cast.numberOfMBs",
1467 FT_UINT32, BASE_DEC, NULL, 0x0,
1468 NULL, HFILL }
1471 { &hf_cast_pictureNumber,
1472 { "PictureNumber", "cast.pictureNumber",
1473 FT_UINT32, BASE_DEC, NULL, 0x0,
1474 NULL, HFILL }
1477 { &hf_cast_longTermPictureIndex,
1478 { "LongTermPictureIndex", "cast.longTermPictureIndex",
1479 FT_UINT32, BASE_DEC, NULL, 0x0,
1480 "LongTermPictureIndex.",
1481 HFILL }
1484 { &hf_cast_recoveryReferencePictureCount,
1485 { "RecoveryReferencePictureCount", "cast.recoveryReferencePictureCount",
1486 FT_UINT32, BASE_DEC, NULL, 0x0,
1487 "RecoveryReferencePictureCount.",
1488 HFILL }
1491 { &hf_cast_calledParty,
1492 { "CalledParty", "cast.calledParty",
1493 FT_STRING, BASE_NONE, NULL, 0x0,
1494 "The number called.",
1495 HFILL }
1498 { &hf_cast_privacy,
1499 { "Privacy", "cast.privacy",
1500 FT_UINT32, BASE_DEC, NULL, 0x0,
1501 NULL, HFILL }
1504 { &hf_cast_precedenceLv,
1505 { "PrecedenceLv", "cast.precedenceLv",
1506 FT_UINT32, BASE_DEC, NULL, 0x0,
1507 NULL, HFILL }
1510 { &hf_cast_precedenceDm,
1511 { "PrecedenceDm", "cast.precedenceDm",
1512 FT_UINT32, BASE_DEC, NULL, 0x0,
1513 NULL, HFILL }
1516 { &hf_cast_callState,
1517 { "CallState", "cast.callState",
1518 FT_UINT32, BASE_DEC, VALS(cast_callStateTypes), 0x0,
1519 NULL, HFILL }
1522 { &hf_cast_callingPartyName,
1523 { "Calling Party Name", "cast.callingPartyName",
1524 FT_STRING, BASE_NONE, NULL, 0x0,
1525 "The passed name of the calling party.",
1526 HFILL }
1529 { &hf_cast_callingParty,
1530 { "Calling Party", "cast.callingParty",
1531 FT_STRING, BASE_NONE, NULL, 0x0,
1532 "The passed number of the calling party.",
1533 HFILL }
1536 { &hf_cast_calledPartyName,
1537 { "Called Party Name", "cast.calledPartyName",
1538 FT_STRING, BASE_NONE, NULL, 0x0,
1539 "The name of the party we are calling.",
1540 HFILL }
1543 { &hf_cast_callType,
1544 { "Call Type", "cast.callType",
1545 FT_UINT32, BASE_DEC, VALS(cast_callTypes), 0x0,
1546 "What type of call, in/out/etc",
1547 HFILL }
1550 { &hf_cast_originalCalledPartyName,
1551 { "Original Called Party Name", "cast.originalCalledPartyName",
1552 FT_STRING, BASE_NONE, NULL, 0x0,
1553 "name of the original person who placed the call.",
1554 HFILL }
1557 { &hf_cast_originalCalledParty,
1558 { "Original Called Party", "cast.originalCalledParty",
1559 FT_STRING, BASE_NONE, NULL, 0x0,
1560 "The number of the original calling party.",
1561 HFILL }
1564 { &hf_cast_lastRedirectingPartyName,
1565 { "LastRedirectingPartyName", "cast.lastRedirectingPartyName",
1566 FT_STRING, BASE_NONE, NULL, 0x0,
1567 NULL, HFILL }
1570 { &hf_cast_lastRedirectingParty,
1571 { "LastRedirectingParty", "cast.lastRedirectingParty",
1572 FT_STRING, BASE_NONE, NULL, 0x0,
1573 NULL, HFILL }
1576 { &hf_cast_cgpnVoiceMailbox,
1577 { "CgpnVoiceMailbox", "cast.cgpnVoiceMailbox",
1578 FT_STRING, BASE_NONE, NULL, 0x0,
1579 NULL, HFILL }
1582 { &hf_cast_cdpnVoiceMailbox,
1583 { "CdpnVoiceMailbox", "cast.cdpnVoiceMailbox",
1584 FT_STRING, BASE_NONE, NULL, 0x0,
1585 NULL, HFILL }
1588 { &hf_cast_originalCdpnVoiceMailbox,
1589 { "OriginalCdpnVoiceMailbox", "cast.originalCdpnVoiceMailbox",
1590 FT_STRING, BASE_NONE, NULL, 0x0,
1591 NULL, HFILL }
1594 { &hf_cast_lastRedirectingVoiceMailbox,
1595 { "LastRedirectingVoiceMailbox", "cast.lastRedirectingVoiceMailbox",
1596 FT_STRING, BASE_NONE, NULL, 0x0,
1597 NULL, HFILL }
1600 { &hf_cast_originalCdpnRedirectReason,
1601 { "OriginalCdpnRedirectReason", "cast.originalCdpnRedirectReason",
1602 FT_UINT32, BASE_DEC, NULL, 0x0,
1603 NULL, HFILL }
1606 { &hf_cast_lastRedirectingReason,
1607 { "LastRedirectingReason", "cast.lastRedirectingReason",
1608 FT_UINT32, BASE_DEC, NULL, 0x0,
1609 NULL, HFILL }
1612 { &hf_cast_callInstance,
1613 { "CallInstance", "cast.callInstance",
1614 FT_UINT32, BASE_DEC, NULL, 0x0,
1615 NULL, HFILL }
1618 { &hf_cast_callSecurityStatus,
1619 { "CallSecurityStatus", "cast.callSecurityStatus",
1620 FT_UINT32, BASE_DEC, VALS(cast_callSecurityStatusTypes), 0x0,
1621 NULL, HFILL }
1624 { &hf_cast_partyPIRestrictionBits_CallingPartyName,
1625 { "RestrictCallingPartyName", "cast.partyPIRestrictionBits.CallingPartyName",
1626 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x01,
1627 NULL, HFILL }
1630 { &hf_cast_partyPIRestrictionBits_CallingPartyNumber,
1631 { "RestrictCallingPartyNumber", "cast.partyPIRestrictionBits.CallingPartyNumber",
1632 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x02,
1633 NULL, HFILL }
1636 { &hf_cast_partyPIRestrictionBits_CalledPartyName,
1637 { "RestrictCalledPartyName", "cast.partyPIRestrictionBits.CalledPartyName",
1638 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x04,
1639 NULL, HFILL }
1642 { &hf_cast_partyPIRestrictionBits_CalledPartyNumber,
1643 { "RestrictCalledPartyNumber", "cast.partyPIRestrictionBits.CalledPartyNumber",
1644 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x08,
1645 NULL, HFILL }
1648 { &hf_cast_partyPIRestrictionBits_OriginalCalledPartyName,
1649 { "RestrictOriginalCalledPartyName", "cast.partyPIRestrictionBits.OriginalCalledPartyName",
1650 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x10,
1651 NULL, HFILL }
1654 { &hf_cast_partyPIRestrictionBits_OriginalCalledPartyNumber,
1655 { "RestrictOriginalCalledPartyNumber", "cast.partyPIRestrictionBits.OriginalCalledPartyNumber",
1656 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x20,
1657 NULL, HFILL }
1660 { &hf_cast_partyPIRestrictionBits_LastRedirectPartyName,
1661 { "RestrictLastRedirectPartyName", "cast.partyPIRestrictionBits.LastRedirectPartyName",
1662 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x40,
1663 NULL, HFILL }
1666 { &hf_cast_partyPIRestrictionBits_LastRedirectPartyNumber,
1667 { "RestrictLastRedirectPartyNumber", "cast.partyPIRestrictionBits.LastRedirectPartyNumber",
1668 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x80,
1669 NULL, HFILL }
1672 { &hf_cast_directoryNumber,
1673 { "Directory Number", "cast.directoryNumber",
1674 FT_STRING, BASE_NONE, NULL, 0x0,
1675 "The number we are reporting statistics for.",
1676 HFILL }
1679 { &hf_cast_requestorIpAddress,
1680 { "RequestorIpAddress", "cast.requestorIpAddress",
1681 FT_IPv4, BASE_NONE, NULL, 0x0,
1682 NULL, HFILL }
1685 { &hf_cast_stationIpAddress,
1686 { "StationIpAddress", "cast.stationIpAddress",
1687 FT_IPv4, BASE_NONE, NULL, 0x0,
1688 NULL, HFILL }
1691 { &hf_cast_stationFriendlyName,
1692 { "StationFriendlyName", "cast.stationFriendlyName",
1693 FT_STRING, BASE_NONE, NULL, 0x0,
1694 NULL, HFILL }
1697 { &hf_cast_stationGUID,
1698 { "stationGUID", "cast.stationGUID",
1699 FT_STRING, BASE_NONE, NULL, 0x0,
1700 NULL, HFILL }
1703 { &hf_cast_audio,
1704 { "AudioCodec", "cast.audio",
1705 FT_UINT32, BASE_DEC, VALS(audioCodecTypes), 0x0,
1706 "The audio codec that is in use.",
1707 HFILL }
1710 { &hf_cast_bitRate,
1711 { "BitRate", "cast.bitRate",
1712 FT_UINT32, BASE_DEC, NULL, 0x0,
1713 NULL, HFILL }
1718 /* Setup protocol subtree array */
1719 static gint *ett[] = {
1720 &ett_cast,
1721 &ett_cast_tree,
1724 module_t *cast_module;
1726 /* Register the protocol name and description */
1727 proto_cast = proto_register_protocol("Cast Client Control Protocol",
1728 "CAST", "cast");
1730 proto_register_field_array(proto_cast, hf, array_length(hf));
1731 proto_register_subtree_array(ett, array_length(ett));
1733 cast_module = prefs_register_protocol(proto_cast, NULL);
1734 prefs_register_bool_preference(cast_module, "reassembly", /*"desegment",*/
1735 "Reassemble CAST messages spanning multiple TCP segments",
1736 "Whether the CAST dissector should reassemble messages spanning multiple TCP segments."
1737 " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
1738 &cast_desegment);
1741 void
1742 proto_reg_handoff_cast(void)
1744 dissector_handle_t cast_handle;
1746 data_handle = find_dissector("data");
1747 cast_handle = new_create_dissector_handle(dissect_cast, proto_cast);
1748 dissector_add_uint("tcp.port", TCP_PORT_CAST, cast_handle);