3 * Dissector for the CAST Client Control Protocol
4 * (The "D-Channel"-Protocol for Cisco Systems' IP-Phones)
6 * $Id: packet-cast.c,v 1.2 2004/02/20 22:34:59 guy Exp $
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 /* This implementation is based on a draft version of the 3.0
33 #include <epan/packet.h>
36 #include "packet-tcp.h"
38 #define TCP_PORT_CAST 4224
41 /* I will probably need this again when I change things
42 * to function pointers, but let me use the existing
43 * infrastructure for now
51 static const value_string message_id[] = {
53 {0x0000, "KeepAliveMessage"},
54 {0x0001, "KeepAliveVersionMessage"},
55 {0x0002, "KeepAliveVersionACKMessage"},
56 {0x0003, "UpdateCapabilitiesMessage"},
57 {0x0004, "EmptyCapabilitiesMessage"},
58 {0x0005, "OpenMultiMediaReceiveChannelMessage"},
59 {0x0006, "OpenMultiMediaReceiveChannelACKMessage"},
60 {0x0007, "CloseMultiMediaReceiveChannelMessage"},
61 {0x0008, "StartMultiMediaTransmissionMessage"},
62 {0x0009, "StopMultiMediaTransmissionMessage"},
63 {0x000A, "MiscellaneousCommandMessage"},
64 {0x000B, "FlowControlCommandMessage"},
65 {0x000C, "ClearConferenceMessage"},
66 {0x000D, "CallStateMessage"},
67 {0x000E, "RequestCallStateMessage"},
68 {0x000F, "RequestAllCallStatesMessage"},
69 {0x0010, "CallInfoMessage"},
70 {0x0011, "RequestCallInfoMessage"},
71 {0x0012, "CallFocusMessage"},
72 {0x0013, "MakeCallMessage"},
73 {0x0014, "HangUpMessage"},
74 {0x0015, "AnswerMessage"},
76 {0x0040, "KeepAliveACKMessage"},
77 {0x0041, "StreamStartMessage"},
78 {0x0042, "StreamStopMessage"},
79 {0x0043, "MuteStartMessage"},
80 {0x0044, "MuteStopMessage"},
81 {0x0045, "SpeakerStartMessage"},
82 {0x0046, "SpeakerStopMessage"},
83 {0x0047, "StreamStartMessageWithCodec"},
85 {0x0050, "VIEODiscoveryprotocol"},
86 {0x0051, "VIEOControlprotocol"},
88 {0x0060, "T120protocol"},
89 {0x0061, "T121protocol"},
90 {0x0062, "T122protocol"},
92 {0x0070, "IMSessionDiscoveryprotocol"},
93 {0x0071, "IMSessionControlprotocol"},
95 {0x0074, "SlidesDiscoveryprotocol"},
96 {0x0075, "SlidesControlprotocol"},
98 {0x0080, "CastTunnelMessage"},
100 {0x0090, "RemoteRequestMessage"},
101 {0x0091, "RemoteResponseMessage"},
103 {0x00A0, "CollabDiscoveryprotocol"},
104 {0x00A1, "CollabControlprotocol"},
106 {0x00A4, "FECCDiscoveryprotocol"},
107 {0x00A5, "FECCControlprotocol"},
109 {0x00B0, "ClockSyncprotocol"},
110 {0x00B1, "StreamSyncprotocol"},
112 {0x00B4, "MediaDiscoveryprotocol"},
113 {0x00B5, "MediaControlprotocol"},
115 {0x00C0, "SessionDiscoveryprotocol"},
116 {0x00C1, "SessionControlprotocol"},
118 {0x00C4, "ConferenceDiscoveryprotocol"},
119 {0x00C5, "Conferenceprotocol"},
121 {0x00CC, "SCCPCallControlProxyprotocol"},
123 {0x00D0, "CallDiscoveryprotocol"},
124 {0x00D1, "CallControlprotocol"},
126 {0 , NULL} /* terminator */
129 static const value_string audioCodecTypes[] = {
139 static const value_string orcStatus[] = {
145 static const value_string mediaPayloads[] = {
146 {1 , "Non-standard codec"},
147 {2 , "G.711 A-law 64k"},
148 {3 , "G.711 A-law 56k"},
149 {4 , "G.711 u-law 64k"},
150 {5 , "G.711 u-law 56k"},
157 {12 , "G.729 Annex A"},
158 {13 , "IS11172 AudioCap"}, /* IS11172 is an ISO MPEG standard */
159 {14 , "IS13818 AudioCap"}, /* IS13818 is an ISO MPEG standard */
160 {15 , "G.729 Annex B"},
161 {16 , "G.729 Annex A+Annex B"},
162 {18 , "GSM Full Rate"},
163 {19 , "GSM Half Rate"},
164 {20 , "GSM Enhanced Full Rate"},
165 {25 , "Wideband 256k"},
169 {81 , "ActiveVoice"},
174 {86 , "G.729B Low Complexity"},
180 {257 , "RFC2833_DynPayload"},
184 static const value_string cast_Layouts[] = {
189 {4 , "TwoByTwo3Alt1"},
190 {5 , "TwoByTwo3Alt2"},
191 {6 , "ThreeByThree"},
192 {7 , "ThreeByThree6Alt1"},
193 {8 , "ThreeByThree6Alt2"},
194 {9 , "ThreeByThree4Alt1"},
195 {10 , "ThreeByThree4Alt2"},
199 static const value_string cast_transmitOrReceive[] = {
200 {1 , "Station_Receive_only"},
201 {2 , "Station_Transmit_only"},
202 {3 , "Station_Receive_Transmit"},
206 static const value_string cast_formatTypes[] = {
207 {1 , "sqcif (128x96)"},
208 {2 , "qcif (176x144)"},
209 {3 , "cif (352x288)"},
210 {4 , "4cif (704x576)"},
211 {5 , "16cif (1408x1152)"},
216 static const value_string cast_echoCancelTypes[] = {
217 {0 , "Media_EchoCancellation_Off"},
218 {1 , "Media_EchoCancellation_On"},
222 static const value_string cast_g723BitRates[] = {
223 {1 , "Media_G723BRate_5_3"},
224 {2 , "Media_G723BRate_6_4"},
228 static const value_string cast_miscCommandType[] = {
229 {0 , "videoFreezePicture"},
230 {1 , "videoFastUpdatePicture"},
231 {2 , "videoFastUpdateGOB"},
232 {3 , "videoFastUpdateMB"},
234 {5 , "lostPartialPicture"},
235 {6 , "recoveryReferencePicture"},
236 {7 , "temporalSpatialTradeOff"},
240 static const value_string cast_callStateTypes[] = {
248 {7 , "TsCongestion"},
250 {9 , "TsCallWaiting"},
251 {10 , "TsCallTransfer"},
254 {13 , "TsCallRemoteMultiline"},
255 {14 , "TsInvalidNumber"},
260 /* Defined Call Type */
261 static const value_string cast_callTypes[] = {
263 {2 , "OutBoundCall"},
268 static const value_string cast_callSecurityStatusTypes[] = {
269 {0 , "CallSecurityStatusUnknown"},
270 {1 , "CallSecurityStatusNotAuthenticated"},
271 {2 , "CallSecurityStatusAuthenticated"},
276 #define MAX_CUSTOM_PICTURES 6
277 #define MAX_SERVICE_TYPE 4
278 #define MAX_LAYOUT_WITH_SAME_SERVICE 5
279 #define MAX_PICTURE_FORMAT 5
280 #define MAX_REFERENCE_PICTURE 4
281 #define MAX_LEVEL_PREFERENCE 4
282 #define StationMaxVideoCapabilities 10
283 #define StationMaxDataCapabilities 5
284 #define StationMaxNameSize 40 /* max size of calling party's name */
285 #define StationMaxDirnumSize 24 /* max size of calling or called party dirnum */
288 static void dissect_cast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
290 /* Initialize the protocol and registered fields */
291 static int proto_cast = -1;
292 static int hf_cast_data_length = -1;
293 static int hf_cast_reserved = -1;
294 static int hf_cast_messageid = -1;
295 static int hf_cast_version = -1;
296 static int hf_cast_ORCStatus = -1;
297 static int hf_cast_ipAddress = -1;
298 static int hf_cast_portNumber = -1;
299 static int hf_cast_passThruPartyID = -1;
300 static int hf_cast_callIdentifier = -1;
301 static int hf_cast_conferenceID = -1;
302 static int hf_cast_payloadType = -1;
303 static int hf_cast_lineInstance = -1;
304 static int hf_cast_payloadCapability = -1;
305 static int hf_cast_isConferenceCreator = -1;
306 static int hf_cast_payload_rfc_number = -1;
307 static int hf_cast_videoCapCount = -1;
308 static int hf_cast_dataCapCount = -1;
309 static int hf_cast_RTPPayloadFormat = -1;
310 static int hf_cast_customPictureFormatCount = -1;
311 static int hf_cast_pictureWidth = -1;
312 static int hf_cast_pictureHeight = -1;
313 static int hf_cast_pixelAspectRatio = -1;
314 static int hf_cast_clockConversionCode = -1;
315 static int hf_cast_clockDivisor = -1;
316 static int hf_cast_activeStreamsOnRegistration = -1;
317 static int hf_cast_maxBW = -1;
318 static int hf_cast_serviceResourceCount = -1;
319 static int hf_cast_layoutCount = -1;
320 static int hf_cast_layout = -1;
321 static int hf_cast_maxConferences = -1;
322 static int hf_cast_activeConferenceOnRegistration = -1;
323 static int hf_cast_transmitOrReceive = -1;
324 static int hf_cast_levelPreferenceCount = -1;
325 static int hf_cast_transmitPreference = -1;
326 static int hf_cast_format = -1;
327 static int hf_cast_maxBitRate = -1;
328 static int hf_cast_minBitRate = -1;
329 static int hf_cast_MPI = -1;
330 static int hf_cast_serviceNumber = -1;
331 static int hf_cast_temporalSpatialTradeOffCapability = -1;
332 static int hf_cast_stillImageTransmission = -1;
333 static int hf_cast_h263_capability_bitfield = -1;
334 static int hf_cast_annexNandWFutureUse = -1;
335 static int hf_cast_modelNumber = -1;
336 static int hf_cast_bandwidth = -1;
337 static int hf_cast_protocolDependentData = -1;
338 static int hf_cast_DSCPValue = -1;
339 static int hf_cast_serviceNum = -1;
340 static int hf_cast_precedenceValue = -1;
341 static int hf_cast_maxStreams = -1;
342 static int hf_cast_millisecondPacketSize = -1;
343 static int hf_cast_echoCancelType = -1;
344 static int hf_cast_g723BitRate = -1;
345 static int hf_cast_bitRate = -1;
346 static int hf_cast_pictureFormatCount = -1;
347 static int hf_cast_confServiceNum = -1;
348 static int hf_cast_miscCommandType = -1;
349 static int hf_cast_temporalSpatialTradeOff = -1;
350 static int hf_cast_firstGOB = -1;
351 static int hf_cast_numberOfGOBs = -1;
352 static int hf_cast_firstMB = -1;
353 static int hf_cast_numberOfMBs = -1;
354 static int hf_cast_pictureNumber = -1;
355 static int hf_cast_longTermPictureIndex = -1;
356 static int hf_cast_recoveryReferencePictureCount = -1;
357 static int hf_cast_calledParty = -1;
358 static int hf_cast_privacy = -1;
359 static int hf_cast_precedenceLv = -1;
360 static int hf_cast_precedenceDm = -1;
361 static int hf_cast_callState = -1;
362 static int hf_cast_callingPartyName = -1;
363 static int hf_cast_callingParty = -1;
364 static int hf_cast_calledPartyName = -1;
365 static int hf_cast_callType = -1;
366 static int hf_cast_originalCalledPartyName = -1;
367 static int hf_cast_originalCalledParty = -1;
368 static int hf_cast_lastRedirectingPartyName = -1;
369 static int hf_cast_lastRedirectingParty = -1;
370 static int hf_cast_cgpnVoiceMailbox = -1;
371 static int hf_cast_cdpnVoiceMailbox = -1;
372 static int hf_cast_originalCdpnVoiceMailbox = -1;
373 static int hf_cast_lastRedirectingVoiceMailbox = -1;
374 static int hf_cast_originalCdpnRedirectReason = -1;
375 static int hf_cast_lastRedirectingReason = -1;
376 static int hf_cast_callInstance = -1;
377 static int hf_cast_callSecurityStatus = -1;
378 static int hf_cast_directoryNumber = -1;
379 static int hf_cast_requestorIpAddress = -1;
380 static int hf_cast_stationIpAddress = -1;
381 static int hf_cast_stationFriendlyName = -1;
382 static int hf_cast_stationGUID = -1;
383 static int hf_cast_audio = -1;
387 /* Initialize the subtree pointers */
388 static gint ett_cast = -1;
389 static gint ett_cast_tree = -1;
391 /* desegmentation of SCCP */
392 static gboolean cast_desegment = TRUE;
394 static dissector_handle_t data_handle;
396 /* Dissect a single CAST PDU */
397 static void dissect_cast_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
402 guint32 hdr_data_length;
404 guint32 data_messageid;
405 gchar *messageid_str;
406 /* guint32 data_size; */
413 /* Set up structures we will need to add the protocol subtree and manage it */
415 proto_tree *cast_tree = NULL;
417 proto_tree *cast_sub_tree;
418 proto_tree *cast_sub_tree_sav;
419 proto_tree *cast_sub_tree_sav_sav;
421 hdr_data_length = tvb_get_letohl(tvb, offset);
422 hdr_marker = tvb_get_letohl(tvb, offset+4);
423 data_messageid = tvb_get_letohl(tvb, offset+8);
425 /* In the interest of speed, if "tree" is NULL, don't do any work not
426 * necessary to generate protocol tree items. */
428 ti = proto_tree_add_item(tree, proto_cast, tvb, offset, hdr_data_length+8, FALSE);
429 cast_tree = proto_item_add_subtree(ti, ett_cast);
430 proto_tree_add_uint(cast_tree, hf_cast_data_length, tvb, offset, 4, hdr_data_length);
431 proto_tree_add_uint(cast_tree, hf_cast_reserved, tvb, offset+4, 4, hdr_marker);
434 messageid_str = val_to_str(data_messageid, message_id, "0x%08X (Unknown)");
436 if (check_col(pinfo->cinfo, COL_INFO)) {
437 col_add_str(pinfo->cinfo, COL_INFO, messageid_str);
441 proto_tree_add_uint(cast_tree, hf_cast_messageid, tvb,offset+8, 4, data_messageid );
445 switch(data_messageid) {
447 case 0x0 : /* keepAlive */
448 /* no data in message */
451 case 0x1 : /* KeepAliveVersion */
452 proto_tree_add_item(cast_tree, hf_cast_version, tvb, offset+12, 4, TRUE);
455 case 0x2 : /* KeepAliveVersionAck */
456 proto_tree_add_item(cast_tree, hf_cast_version, tvb, offset+12, 4, TRUE);
459 case 0x3 : /* UpdateCapabilities */
460 /* to do - this message is very large and will span multiple packets, it would be nice to someday */
461 /* find out a way to join the next packet and get the complete message to decode */
462 proto_tree_add_item(cast_tree, hf_cast_videoCapCount, tvb, offset+12, 4, TRUE);
463 proto_tree_add_item(cast_tree, hf_cast_dataCapCount, tvb, offset+16, 4, TRUE);
464 proto_tree_add_item(cast_tree, hf_cast_RTPPayloadFormat, tvb, offset+20, 4, TRUE);
465 proto_tree_add_item(cast_tree, hf_cast_customPictureFormatCount, tvb, offset+24, 4, TRUE);
467 /* total of 120 bytes */
468 for ( i = 0; i < MAX_CUSTOM_PICTURES; i++ ) {
469 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 20, "customPictureFormat[%d]", i);
470 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
471 proto_tree_add_item(cast_sub_tree, hf_cast_pictureWidth, tvb, count, 4, TRUE);
473 proto_tree_add_item(cast_sub_tree, hf_cast_pictureHeight, tvb, count, 4, TRUE);
475 proto_tree_add_item(cast_sub_tree, hf_cast_pixelAspectRatio, tvb, count, 4, TRUE);
477 proto_tree_add_item(cast_sub_tree, hf_cast_clockConversionCode, tvb, count, 4, TRUE);
479 proto_tree_add_item(cast_sub_tree, hf_cast_clockDivisor, tvb, count, 4, TRUE);
482 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 8, "confResources");
483 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
484 proto_tree_add_item(cast_sub_tree, hf_cast_activeStreamsOnRegistration, tvb, count, 4, TRUE);
486 proto_tree_add_item(cast_sub_tree, hf_cast_maxBW, tvb, count, 4, TRUE);
488 proto_tree_add_item(cast_sub_tree, hf_cast_serviceResourceCount, tvb, count, 4, TRUE);
490 cast_sub_tree_sav = cast_sub_tree;
491 /* total of 160 bytes */
492 for ( i = 0; i < MAX_SERVICE_TYPE; i++ ) {
493 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 20, "serviceResource[%d]", i);
494 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
495 proto_tree_add_item(cast_sub_tree, hf_cast_layoutCount, tvb, count, 4, TRUE);
497 cast_sub_tree_sav_sav = cast_sub_tree_sav;
498 for ( t = 0; t < MAX_LAYOUT_WITH_SAME_SERVICE; t++ ) {
499 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 20, "layouts[%d]", t);
500 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
501 proto_tree_add_item(cast_sub_tree, hf_cast_layout, tvb, count, 4, TRUE);
504 cast_sub_tree = cast_sub_tree_sav_sav;
505 proto_tree_add_item(cast_sub_tree, hf_cast_serviceNum, tvb, count, 4, TRUE);
507 proto_tree_add_item(cast_sub_tree, hf_cast_maxStreams, tvb, count, 4, TRUE);
509 proto_tree_add_item(cast_sub_tree, hf_cast_maxConferences, tvb, count, 4, TRUE);
511 proto_tree_add_item(cast_sub_tree, hf_cast_activeConferenceOnRegistration, tvb, count, 4, TRUE);
514 /* total of 176 bytes */
515 for ( i = 0; i < StationMaxVideoCapabilities; i++ ) {
516 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 20, "vidCaps[%d]", i);
517 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
518 proto_tree_add_item(cast_sub_tree, hf_cast_payloadCapability, tvb, count, 4, TRUE);
520 proto_tree_add_item(cast_sub_tree, hf_cast_transmitOrReceive, tvb, count, 4, TRUE);
522 proto_tree_add_item(cast_sub_tree, hf_cast_levelPreferenceCount, tvb, count, 4, TRUE);
524 cast_sub_tree_sav = cast_sub_tree;
525 for ( t = 0; t < MAX_LEVEL_PREFERENCE; t++ ) {
526 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 20, "levelPreference[%d]", t);
527 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
528 proto_tree_add_item(cast_sub_tree, hf_cast_transmitPreference, tvb, count, 4, TRUE);
530 proto_tree_add_item(cast_sub_tree, hf_cast_format, tvb, count, 4, TRUE);
532 proto_tree_add_item(cast_sub_tree, hf_cast_maxBitRate, tvb, count, 4, TRUE);
534 proto_tree_add_item(cast_sub_tree, hf_cast_minBitRate, tvb, count, 4, TRUE);
536 proto_tree_add_item(cast_sub_tree, hf_cast_MPI, tvb, count, 4, TRUE);
538 proto_tree_add_item(cast_sub_tree, hf_cast_serviceNumber, tvb, count, 4, TRUE);
543 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8, "h261VideoCapability");
544 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
545 proto_tree_add_item(cast_sub_tree, hf_cast_temporalSpatialTradeOffCapability, tvb, count, 4, TRUE);
546 proto_tree_add_item(cast_sub_tree, hf_cast_stillImageTransmission, tvb, count+4, 4, TRUE);
549 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8, "h263VideoCapability");
550 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
551 proto_tree_add_item(cast_sub_tree, hf_cast_h263_capability_bitfield, tvb, count, 4, TRUE);
552 proto_tree_add_item(cast_sub_tree, hf_cast_annexNandWFutureUse, tvb, count+4, 4, TRUE);
555 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8, "vieoVideoCapability");
556 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
557 proto_tree_add_item(cast_sub_tree, hf_cast_modelNumber, tvb, count, 4, TRUE);
559 proto_tree_add_item(cast_sub_tree, hf_cast_bandwidth, tvb, count, 4, TRUE);
563 for ( i = 0; i < StationMaxDataCapabilities; i++ ) {
564 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 20, "dataCaps[%d]", i);
565 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
566 proto_tree_add_item(cast_sub_tree, hf_cast_payloadCapability, tvb, count, 4, TRUE);
568 proto_tree_add_item(cast_sub_tree, hf_cast_transmitOrReceive, tvb, count, 4, TRUE);
570 proto_tree_add_item(cast_sub_tree, hf_cast_protocolDependentData, tvb, count, 4, TRUE);
572 proto_tree_add_item(cast_sub_tree, hf_cast_maxBitRate, tvb, count, 4, TRUE);
580 case 0x5 : /* OpenMultiMediaReceiveChannel */
581 proto_tree_add_item(cast_tree, hf_cast_conferenceID, tvb, offset+12, 4, TRUE);
582 proto_tree_add_item(cast_tree, hf_cast_passThruPartyID, tvb, offset+16, 4, TRUE);
583 proto_tree_add_item(cast_tree, hf_cast_payloadCapability, tvb, offset+20, 4, TRUE);
584 proto_tree_add_item(cast_tree, hf_cast_lineInstance, tvb, offset+24, 4, TRUE);
585 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, offset+28, 4, TRUE);
586 proto_tree_add_item(cast_tree, hf_cast_payload_rfc_number, tvb, offset+32, 4, TRUE);
587 proto_tree_add_item(cast_tree, hf_cast_payloadType, tvb, offset+36, 4, TRUE);
588 proto_tree_add_item(cast_tree, hf_cast_isConferenceCreator, tvb, offset+40, 4, TRUE);
590 /* add audio part of union */
591 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 12, "audioParameters");
592 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
593 proto_tree_add_item(cast_sub_tree, hf_cast_millisecondPacketSize, tvb, offset+44, 4, TRUE);
594 proto_tree_add_item(cast_sub_tree, hf_cast_echoCancelType, tvb, offset+48, 4, TRUE);
595 proto_tree_add_item(cast_sub_tree, hf_cast_g723BitRate, tvb, offset+52, 4, TRUE);
597 /* add video part of union */
598 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 30, "videoParameters");
599 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
600 proto_tree_add_item(cast_sub_tree, hf_cast_bitRate, tvb, offset+44, 4, TRUE);
601 proto_tree_add_item(cast_sub_tree, hf_cast_pictureFormatCount, tvb, offset+48, 4, TRUE);
602 cast_sub_tree_sav = cast_sub_tree;
604 for ( i = 0; i < MAX_PICTURE_FORMAT; i++ ) {
605 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8 * MAX_PICTURE_FORMAT, "pictureFormat[%d]", i);
606 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
607 proto_tree_add_item(cast_sub_tree, hf_cast_format, tvb, count, 4, TRUE);
609 proto_tree_add_item(cast_sub_tree, hf_cast_MPI, tvb, count, 4, TRUE);
612 cast_sub_tree = cast_sub_tree_sav;
613 proto_tree_add_item(cast_sub_tree, hf_cast_confServiceNum, tvb, count, 4, TRUE);
616 /* add H261 part of union */
617 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8, "h261VideoCapability");
618 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
619 proto_tree_add_item(cast_sub_tree, hf_cast_temporalSpatialTradeOffCapability, tvb, count, 4, TRUE);
620 proto_tree_add_item(cast_sub_tree, hf_cast_stillImageTransmission, tvb, count+4, 4, TRUE);
622 /* add H263 part of union */
623 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8, "h263VideoCapability");
624 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
625 proto_tree_add_item(cast_sub_tree, hf_cast_h263_capability_bitfield, tvb, count, 4, TRUE);
626 proto_tree_add_item(cast_sub_tree, hf_cast_annexNandWFutureUse, tvb, count+4, 4, TRUE);
628 /* add Vieo part of union */
629 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8, "vieoVideoCapability");
630 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
631 proto_tree_add_item(cast_sub_tree, hf_cast_modelNumber, tvb, count, 4, TRUE);
633 proto_tree_add_item(cast_sub_tree, hf_cast_bandwidth, tvb, count, 4, TRUE);
635 /* add data part of union */
636 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 8, "dataParameters");
637 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
638 proto_tree_add_item(cast_sub_tree, hf_cast_protocolDependentData, tvb, offset+44, 4, TRUE);
639 proto_tree_add_item(cast_sub_tree, hf_cast_maxBitRate, tvb, offset+48, 4, TRUE);
642 case 0x6 : /* OpenMultiMediaReceiveChannelACK */
643 proto_tree_add_item(cast_tree, hf_cast_ORCStatus, tvb, offset+12, 4, TRUE);
644 proto_tree_add_item(cast_tree, hf_cast_ipAddress, tvb, offset+16, 4, TRUE);
645 proto_tree_add_item(cast_tree, hf_cast_portNumber, tvb, offset+20, 4, TRUE);
646 proto_tree_add_item(cast_tree, hf_cast_passThruPartyID, tvb, offset+24, 4, TRUE);
647 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, offset+28, 4, TRUE);
650 case 0x7 : /* CloseMultiMediaReceiveChannel */
651 proto_tree_add_item(cast_tree, hf_cast_conferenceID, tvb, offset+12, 4, TRUE);
652 proto_tree_add_item(cast_tree, hf_cast_passThruPartyID, tvb, offset+16, 4, TRUE);
653 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, offset+20, 4, TRUE);
656 case 0x8 : /* StartMultiMediaTransmission */
657 proto_tree_add_item(cast_tree, hf_cast_conferenceID, tvb, offset+12, 4, TRUE);
658 proto_tree_add_item(cast_tree, hf_cast_passThruPartyID, tvb, offset+16, 4, TRUE);
659 proto_tree_add_item(cast_tree, hf_cast_payloadCapability, tvb, offset+20, 4, TRUE);
660 proto_tree_add_item(cast_tree, hf_cast_ipAddress, tvb, offset+24, 4, TRUE);
661 proto_tree_add_item(cast_tree, hf_cast_portNumber, tvb, offset+28, 4, TRUE);
662 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, offset+32, 4, TRUE);
663 proto_tree_add_item(cast_tree, hf_cast_payload_rfc_number, tvb, offset+36, 4, TRUE);
664 proto_tree_add_item(cast_tree, hf_cast_payloadType, tvb, offset+40, 4, TRUE);
665 proto_tree_add_item(cast_tree, hf_cast_DSCPValue, tvb, offset+44, 4, TRUE);
667 /* add video part of union */
668 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 30, "videoParameters");
669 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
670 proto_tree_add_item(cast_sub_tree, hf_cast_bitRate, tvb, offset+48, 4, TRUE);
671 proto_tree_add_item(cast_sub_tree, hf_cast_pictureFormatCount, tvb, offset+52, 4, TRUE);
672 cast_sub_tree_sav = cast_sub_tree;
674 for ( i = 0; i < MAX_PICTURE_FORMAT; i++ ) {
675 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8 * MAX_PICTURE_FORMAT, "pictureFormat[%d]", i);
676 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
677 proto_tree_add_item(cast_sub_tree, hf_cast_format, tvb, count, 4, TRUE);
679 proto_tree_add_item(cast_sub_tree, hf_cast_MPI, tvb, count, 4, TRUE);
682 cast_sub_tree = cast_sub_tree_sav;
683 proto_tree_add_item(cast_sub_tree, hf_cast_confServiceNum, tvb, count, 4, TRUE);
687 /* add H261 part of union */
688 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8, "h261VideoCapability");
689 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
690 proto_tree_add_item(cast_sub_tree, hf_cast_temporalSpatialTradeOffCapability, tvb, count, 4, TRUE);
692 proto_tree_add_item(cast_sub_tree, hf_cast_stillImageTransmission, tvb, count, 4, TRUE);
694 /* add H263 part of union */
696 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8, "h263VideoCapability");
697 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
698 proto_tree_add_item(cast_sub_tree, hf_cast_h263_capability_bitfield, tvb, count, 4, TRUE);
700 proto_tree_add_item(cast_sub_tree, hf_cast_annexNandWFutureUse, tvb, count, 4, TRUE);
702 /* add Vieo part of union */
704 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8, "vieoVideoCapability");
705 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
706 proto_tree_add_item(cast_sub_tree, hf_cast_modelNumber, tvb, count, 4, TRUE);
708 proto_tree_add_item(cast_sub_tree, hf_cast_bandwidth, tvb, count, 4, TRUE);
710 /* add data part of union */
711 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 8, "dataParameters");
712 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
713 proto_tree_add_item(cast_sub_tree, hf_cast_protocolDependentData, tvb, offset+48, 4, TRUE);
714 proto_tree_add_item(cast_sub_tree, hf_cast_maxBitRate, tvb, offset+52, 4, TRUE);
717 case 0x9 : /* StopMultiMediaTransmission */
718 proto_tree_add_item(cast_tree, hf_cast_conferenceID, tvb, offset+12, 4, TRUE);
719 proto_tree_add_item(cast_tree, hf_cast_passThruPartyID, tvb, offset+16, 4, TRUE);
720 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, offset+20, 4, TRUE);
723 case 0xA : /* MiscellaneousCommand */
724 proto_tree_add_item(cast_tree, hf_cast_conferenceID, tvb, offset+12, 4, TRUE);
725 proto_tree_add_item(cast_tree, hf_cast_passThruPartyID, tvb, offset+16, 4, TRUE);
726 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, offset+20, 4, TRUE);
727 proto_tree_add_item(cast_tree, hf_cast_miscCommandType, tvb, offset+24, 4, TRUE);
729 /* show videoFreezePicture */
730 /* not sure of format */
732 /* show videoFastUpdatePicture */
733 /* not sure of format */
735 /* show videoFastUpdateGOB */
736 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 8, "videoFastUpdateGOB");
737 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
738 proto_tree_add_item(cast_sub_tree, hf_cast_firstGOB, tvb, offset+28, 4, TRUE);
739 proto_tree_add_item(cast_sub_tree, hf_cast_numberOfGOBs, tvb, offset+32, 4, TRUE);
741 /* show videoFastUpdateMB */
742 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 8, "videoFastUpdateGOB");
743 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
744 proto_tree_add_item(cast_sub_tree, hf_cast_firstGOB, tvb, offset+28, 4, TRUE);
745 proto_tree_add_item(cast_sub_tree, hf_cast_firstMB, tvb, offset+32, 4, TRUE);
746 proto_tree_add_item(cast_sub_tree, hf_cast_numberOfMBs, tvb, offset+36, 4, TRUE);
748 /* show lostPicture */
749 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 8, "lostPicture");
750 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
751 proto_tree_add_item(cast_sub_tree, hf_cast_pictureNumber, tvb, offset+28, 4, TRUE);
752 proto_tree_add_item(cast_sub_tree, hf_cast_longTermPictureIndex, tvb, offset+32, 4, TRUE);
754 /* show lostPartialPicture */
755 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 8, "lostPartialPicture");
756 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
757 proto_tree_add_item(cast_sub_tree, hf_cast_pictureNumber, tvb, offset+28, 4, TRUE);
758 proto_tree_add_item(cast_sub_tree, hf_cast_longTermPictureIndex, tvb, offset+32, 4, TRUE);
759 proto_tree_add_item(cast_sub_tree, hf_cast_firstMB, tvb, offset+36, 4, TRUE);
760 proto_tree_add_item(cast_sub_tree, hf_cast_numberOfMBs, tvb, offset+40, 4, TRUE);
762 /* show recoveryReferencePicture */
763 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 8, "recoveryReferencePicture");
764 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
765 proto_tree_add_item(cast_sub_tree, hf_cast_recoveryReferencePictureCount, tvb, offset+28, 4, TRUE);
766 cast_sub_tree_sav = cast_sub_tree;
767 for ( i = 0; i < MAX_REFERENCE_PICTURE; i++ ) {
768 ti_sub = proto_tree_add_text(cast_sub_tree_sav, tvb, offset, 8, "recoveryReferencePicture[%d]", i);
769 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
770 proto_tree_add_item(cast_sub_tree, hf_cast_pictureNumber, tvb, offset+32+(i*8), 4, TRUE);
771 proto_tree_add_item(cast_sub_tree, hf_cast_longTermPictureIndex, tvb, offset+36+(i*8), 4, TRUE);
774 /* show temporalSpatialTradeOff */
775 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 4, "temporalSpatialTradeOff");
776 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
777 proto_tree_add_item(cast_sub_tree, hf_cast_temporalSpatialTradeOff, tvb, offset+28, 4, TRUE);
780 case 0xB : /* FlowControlCommand */
781 proto_tree_add_item(cast_tree, hf_cast_conferenceID, tvb, offset+12, 4, TRUE);
782 proto_tree_add_item(cast_tree, hf_cast_passThruPartyID, tvb, offset+16, 4, TRUE);
783 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, offset+20, 4, TRUE);
784 proto_tree_add_item(cast_tree, hf_cast_maxBitRate, tvb, offset+24, 4, TRUE);
787 case 0xC : /* ClearConference */
788 proto_tree_add_item(cast_tree, hf_cast_conferenceID, tvb, offset+12, 4, TRUE);
789 proto_tree_add_item(cast_tree, hf_cast_serviceNum, tvb, offset+16, 4, TRUE);
792 case 0xD : /* CallState */
793 proto_tree_add_item(cast_tree, hf_cast_callState, tvb, offset+12, 4, TRUE);
794 proto_tree_add_item(cast_tree, hf_cast_lineInstance, tvb, offset+16, 4, TRUE);
795 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, offset+20, 4, TRUE);
796 proto_tree_add_item(cast_tree, hf_cast_privacy, tvb, offset+24, 4, TRUE);
797 proto_tree_add_item(cast_tree, hf_cast_precedenceLv, tvb, offset+28, 4, TRUE);
798 proto_tree_add_item(cast_tree, hf_cast_precedenceDm, tvb, offset+32, 4, TRUE);
801 case 0xE : /* RequestCallState */
802 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, offset+12, 4, TRUE);
805 case 0xF : /* RequestAllCallStates */
806 /* no data in message */
809 case 0x10 : /* CallInfo */
811 proto_tree_add_item(cast_tree, hf_cast_callingPartyName, tvb, i, StationMaxNameSize, TRUE);
812 i += StationMaxNameSize;
813 proto_tree_add_item(cast_tree, hf_cast_callingParty, tvb, i, StationMaxDirnumSize, TRUE);
814 i += StationMaxDirnumSize;
815 proto_tree_add_item(cast_tree, hf_cast_calledPartyName, tvb, i, StationMaxNameSize, TRUE);
816 i += StationMaxNameSize;
817 proto_tree_add_item(cast_tree, hf_cast_calledParty, tvb, i, StationMaxDirnumSize, TRUE);
818 i += StationMaxDirnumSize;
819 proto_tree_add_item(cast_tree, hf_cast_lineInstance, tvb, i, 4, TRUE);
821 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, i, 4, TRUE);
823 proto_tree_add_item(cast_tree, hf_cast_callType, tvb, i, 4, TRUE);
825 proto_tree_add_item(cast_tree, hf_cast_originalCalledPartyName, tvb, i, StationMaxNameSize, TRUE);
826 i += StationMaxNameSize;
827 proto_tree_add_item(cast_tree, hf_cast_originalCalledParty, tvb, i, StationMaxDirnumSize, TRUE);
828 i += StationMaxDirnumSize;
829 proto_tree_add_item(cast_tree, hf_cast_lastRedirectingPartyName, tvb, i, StationMaxNameSize, TRUE);
830 i += StationMaxNameSize;
831 proto_tree_add_item(cast_tree, hf_cast_lastRedirectingParty, tvb, i, StationMaxDirnumSize, TRUE);
832 i += StationMaxDirnumSize;
833 proto_tree_add_item(cast_tree, hf_cast_originalCdpnRedirectReason, tvb, i, 4, TRUE);
835 proto_tree_add_item(cast_tree, hf_cast_lastRedirectingReason, tvb, i, 4, TRUE);
837 proto_tree_add_item(cast_tree, hf_cast_cgpnVoiceMailbox, tvb, i, StationMaxDirnumSize, TRUE);
838 i += StationMaxDirnumSize;
839 proto_tree_add_item(cast_tree, hf_cast_cdpnVoiceMailbox, tvb, i, StationMaxDirnumSize, TRUE);
840 i += StationMaxDirnumSize;
841 proto_tree_add_item(cast_tree, hf_cast_originalCdpnVoiceMailbox, tvb, i, StationMaxDirnumSize, TRUE);
842 i += StationMaxDirnumSize;
843 proto_tree_add_item(cast_tree, hf_cast_lastRedirectingVoiceMailbox, tvb, i, StationMaxDirnumSize, TRUE);
844 i += StationMaxDirnumSize;
845 proto_tree_add_item(cast_tree, hf_cast_callInstance, tvb, i, 4, TRUE);
847 proto_tree_add_item(cast_tree, hf_cast_callSecurityStatus, tvb, i, 4, TRUE);
849 val = tvb_get_letohl( tvb, i);
850 ti_sub = proto_tree_add_text(cast_tree, tvb, offset, 8, "partyPIRestrictionBits");
851 cast_sub_tree = proto_item_add_subtree(ti_sub, ett_cast_tree);
852 proto_tree_add_text(cast_sub_tree, tvb, i, 4,
853 decode_boolean_bitfield( val, 0x01, 4*8, "Does RestrictCallingPartyName", "Doesn't RestrictCallingPartyName"));
854 proto_tree_add_text(cast_sub_tree, tvb, i, 4,
855 decode_boolean_bitfield( val, 0x02, 4*8, "Does RestrictCallingPartyNumber", "Doesn't RestrictCallingPartyNumber"));
856 proto_tree_add_text(cast_sub_tree, tvb, i, 4,
857 decode_boolean_bitfield( val, 0x04, 4*8, "Does RestrictCalledPartyName", "Doesn't RestrictCalledPartyName"));
858 proto_tree_add_text(cast_sub_tree, tvb, i, 4,
859 decode_boolean_bitfield( val, 0x08, 4*8, "Does RestrictCalledPartyNumber", "Doesn't RestrictCalledPartyNumber"));
860 proto_tree_add_text(cast_sub_tree, tvb, i, 4,
861 decode_boolean_bitfield( val, 0x10, 4*8, "Does RestrictOriginalCalledPartyName", "Doesn't RestrictOriginalCalledPartyName"));
862 proto_tree_add_text(cast_sub_tree, tvb, i, 4,
863 decode_boolean_bitfield( val, 0x20, 4*8, "Does RestrictOriginalCalledPartyNumber", "Doesn't RestrictOriginalCalledPartyNumber"));
864 proto_tree_add_text(cast_sub_tree, tvb, i, 4,
865 decode_boolean_bitfield( val, 0x40, 4*8, "Does RestrictLastRedirectPartyName", "Doesn't RestrictLastRedirectPartyName"));
866 proto_tree_add_text(cast_sub_tree, tvb, i, 4,
867 decode_boolean_bitfield( val, 0x80, 4*8, "Does RestrictLastRedirectPartyNumber", "Doesn't RestrictLastRedirectPartyNumber"));
870 case 0x11 : /* RequestCallInfo */
871 proto_tree_add_item(cast_tree, hf_cast_lineInstance, tvb, offset+12, 4, TRUE);
874 case 0x12 : /* CallFocus */
875 proto_tree_add_item(cast_tree, hf_cast_lineInstance, tvb, offset+12, 4, TRUE);
876 proto_tree_add_item(cast_tree, hf_cast_callIdentifier, tvb, offset+16, 4, TRUE);
879 case 0x13 : /* MakeCall */
880 proto_tree_add_item(cast_tree, hf_cast_calledParty, tvb, offset+12, StationMaxDirnumSize, TRUE);
881 proto_tree_add_item(cast_tree, hf_cast_lineInstance, tvb, offset+16, 4, TRUE);
884 case 0x14 : /* HangUp */
885 proto_tree_add_item(cast_tree, hf_cast_lineInstance, tvb, offset+12, 4, TRUE);
888 case 0x15 : /* Answer */
889 proto_tree_add_item(cast_tree, hf_cast_lineInstance, tvb, offset+12, 4, TRUE);
892 case 0x40 : /* keepAliveAck */
893 /* no data in message */
896 case 0x41 : /* StreamStart */
897 /* no data in message */
900 case 0x42 : /* StreamStop */
901 /* no data in message */
904 case 0x43 : /* MuteStart */
905 /* no data in message */
908 case 0x44 : /* MuteStop */
909 /* no data in message */
912 case 0x45 : /* SpeakerStart */
913 /* no data in message */
916 case 0x46 : /* SpeakerStop */
917 /* no data in message */
920 case 0x47 : /* StreamStartMessageWithCodec */
921 proto_tree_add_item(cast_tree, hf_cast_audio, tvb, offset+12, 4, TRUE);
925 case 0x50 : /* VIEODiscoveryprotocol */
928 case 0x51 : /* VIEOControlprotocol */
932 case 0x60 : /* VeT120protocol */
935 case 0x61 : /* VeT121protocol */
938 case 0x62 : /* VeT122protocol */
942 case 0x70 : /* IMSessionDiscoveryprotocol */
945 case 0x71 : /* IMSessionControlprotocol */
949 case 0x74 : /* SlidesDiscoveryprotocol */
952 case 0x75 : /* SlidesControlprotocol */
956 case 0x80 : /* Tunnel */
959 case 0x90 : /* RemoteInfoRequest */
961 proto_tree_add_item(cast_tree, hf_cast_stationFriendlyName, tvb, i, StationMaxNameSize, TRUE);
962 i += StationMaxNameSize;
963 proto_tree_add_item(cast_tree, hf_cast_stationGUID, tvb, i, StationMaxNameSize, TRUE);
964 i += StationMaxNameSize;
965 proto_tree_add_item(cast_tree, hf_cast_requestorIpAddress, tvb, i, 4, TRUE);
968 case 0x91 : /* RemoteInfoResponse */
970 proto_tree_add_item(cast_tree, hf_cast_stationFriendlyName, tvb, i, StationMaxNameSize, TRUE);
971 i += StationMaxNameSize;
972 proto_tree_add_item(cast_tree, hf_cast_stationGUID, tvb, i, StationMaxNameSize, TRUE);
973 i += StationMaxNameSize;
974 proto_tree_add_item(cast_tree, hf_cast_stationIpAddress, tvb, i, 4, TRUE);
976 proto_tree_add_item(cast_tree, hf_cast_directoryNumber, tvb, i, StationMaxNameSize, TRUE);
980 case 0xA0 : /* CollabDiscoveryprotocol */
983 case 0xA1 : /* CollabControlprotocol */
987 case 0xA4 : /* FECCDiscoveryprotocol */
990 case 0xA5 : /* FECCControlprotocol */
994 case 0xB0 : /* ClockSyncprotocol */
997 case 0xB1 : /* StreamSyncprotocol */
1001 case 0xB4 : /* MediaDiscoveryprotocol */
1004 case 0xB5 : /* MediaControlprotocol */
1008 case 0xC0 : /* SessionDiscoveryprotocol */
1011 case 0xC1 : /* SessionControlprotocol */
1015 case 0xC4 : /* ConferenceDiscoveryprotocol */
1018 case 0xC5 : /* Conferenceprotocol */
1022 case 0xCC : /* SCCPCallControlProxyprotocol */
1026 case 0xD0 : /* CallDiscoveryprotocol */
1029 case 0xD1 : /* CallControlprotocol */
1039 /* Get the length of a single CAST PDU */
1040 static guint get_cast_pdu_len(tvbuff_t *tvb, int offset)
1042 guint32 hdr_data_length;
1045 * Get the length of the CAST packet.
1047 hdr_data_length = tvb_get_letohl(tvb, offset);
1050 * That length doesn't include the length of the header itself;
1053 return hdr_data_length + 8;
1056 /* Code to actually dissect the packets */
1057 static void dissect_cast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1059 /* The general structure of a packet: {IP-Header|TCP-Header|n*CAST}
1060 * CAST-Packet: {Header(Size, Reserved)|Data(MessageID, Message-Data)}
1063 volatile guint32 hdr_data_length;
1066 /* check, if this is really an SKINNY packet, they start with a length + 0 */
1068 /* get relevant header information */
1069 hdr_data_length = tvb_get_letohl(tvb, 0);
1070 hdr_marker = tvb_get_letohl(tvb, 4);
1072 /* data_size = MIN(8+hdr_data_length, tvb_length(tvb)) - 0xC; */
1074 if (hdr_data_length < 4 || hdr_marker != 0) {
1075 /* Not an CAST packet, just happened to use the same port */
1076 call_dissector(data_handle,tvb, pinfo, tree);
1080 /* Make entries in Protocol column and Info column on summary display */
1081 if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
1082 col_set_str(pinfo->cinfo, COL_PROTOCOL, "CAST");
1085 if (check_col(pinfo->cinfo, COL_INFO)) {
1086 col_set_str(pinfo->cinfo, COL_INFO, "Cast Client Control Protocol");
1088 tcp_dissect_pdus(tvb, pinfo, tree, cast_desegment, 4, get_cast_pdu_len, dissect_cast_pdu);
1091 /* Register the protocol with Ethereal */
1093 proto_register_cast(void)
1095 /* Setup list of header fields */
1096 static hf_register_info hf[] = {
1097 { &hf_cast_data_length,
1098 { "Data Length", "cast.data_length",
1099 FT_UINT32, BASE_DEC, NULL, 0x0,
1100 "Number of bytes in the data portion.",
1104 { &hf_cast_reserved,
1105 { "Marker", "cast.marker",
1106 FT_UINT32, BASE_HEX, NULL, 0x0,
1107 "Marker value should ne zero.",
1111 /* FIXME: Enable use of message name ??? */
1112 { &hf_cast_messageid,
1113 { "Message ID", "cast.messageid",
1114 FT_UINT32, BASE_HEX, VALS(message_id), 0x0,
1115 "The function requested/done with this message.",
1120 { "Version", "cast.version",
1121 FT_UINT32, BASE_DEC, NULL, 0x0,
1122 "The version in the keepalive version messages.",
1126 { &hf_cast_ORCStatus,
1127 { "ORCStatus", "cast.ORCStatus",
1128 FT_UINT32, BASE_DEC, VALS(orcStatus), 0x0,
1129 "The status of the opened receive channel.",
1133 { &hf_cast_ipAddress,
1134 { "IP Address", "cast.ipAddress",
1135 FT_IPv4, BASE_NONE, NULL, 0x0,
1140 { &hf_cast_portNumber,
1141 { "Port Number", "cast.portNumber",
1142 FT_UINT32, BASE_DEC, NULL, 0x0,
1147 { &hf_cast_passThruPartyID,
1148 { "PassThruPartyID", "cast.passThruPartyID",
1149 FT_UINT32, BASE_DEC, NULL, 0x0,
1150 "The pass thru party id",
1154 { &hf_cast_callIdentifier,
1155 { "Call Identifier", "cast.callIdentifier",
1156 FT_UINT32, BASE_DEC, NULL, 0x0,
1157 "Call identifier for this call.",
1161 { &hf_cast_conferenceID,
1162 { "Conference ID", "cast.conferenceID",
1163 FT_UINT32, BASE_DEC, NULL, 0x0,
1164 "The conference ID",
1168 { &hf_cast_payloadType,
1169 { "PayloadType", "cast.payloadType",
1170 FT_UINT32, BASE_DEC, NULL, 0x0,
1175 { &hf_cast_lineInstance,
1176 { "Line Instance", "cast.lineInstance",
1177 FT_UINT32, BASE_DEC, NULL, 0x0,
1178 "The display call plane associated with this call.",
1182 { &hf_cast_payloadCapability,
1183 { "PayloadCapability", "cast.payloadCapability",
1184 FT_UINT32, BASE_DEC, VALS(mediaPayloads), 0x0,
1185 "The payload capability for this media capability structure.",
1189 { &hf_cast_isConferenceCreator,
1190 { "IsConferenceCreator", "cast.isConferenceCreator",
1191 FT_UINT32, BASE_DEC, NULL, 0x0,
1192 "IsConferenceCreator.",
1196 { &hf_cast_payload_rfc_number,
1197 { "Payload_rfc_number", "cast.payload_rfc_number",
1198 FT_UINT32, BASE_DEC, NULL, 0x0,
1199 "Payload_rfc_number.",
1203 { &hf_cast_videoCapCount,
1204 { "VideoCapCount", "cast.videoCapCount",
1205 FT_UINT32, BASE_DEC, NULL, 0x0,
1210 { &hf_cast_dataCapCount,
1211 { "DataCapCount", "cast.dataCapCount",
1212 FT_UINT32, BASE_DEC, NULL, 0x0,
1217 { &hf_cast_RTPPayloadFormat,
1218 { "RTPPayloadFormat", "cast.RTPPayloadFormat",
1219 FT_UINT32, BASE_DEC, NULL, 0x0,
1220 "RTPPayloadFormat.",
1224 { &hf_cast_customPictureFormatCount,
1225 { "CustomPictureFormatCount", "cast.customPictureFormatCount",
1226 FT_UINT32, BASE_DEC, NULL, 0x0,
1227 "CustomPictureFormatCount.",
1231 { &hf_cast_pictureWidth,
1232 { "PictureWidth", "cast.pictureWidth",
1233 FT_UINT32, BASE_DEC, NULL, 0x0,
1238 { &hf_cast_pictureHeight,
1239 { "PictureHeight", "cast.pictureHeight",
1240 FT_UINT32, BASE_DEC, NULL, 0x0,
1245 { &hf_cast_pixelAspectRatio,
1246 { "PixelAspectRatio", "cast.pixelAspectRatio",
1247 FT_UINT32, BASE_DEC, NULL, 0x0,
1248 "PixelAspectRatio.",
1252 { &hf_cast_clockConversionCode,
1253 { "ClockConversionCode", "cast.clockConversionCode",
1254 FT_UINT32, BASE_DEC, NULL, 0x0,
1255 "ClockConversionCode.",
1259 { &hf_cast_clockDivisor,
1260 { "ClockDivisor", "cast.clockDivisor",
1261 FT_UINT32, BASE_DEC, NULL, 0x0,
1266 { &hf_cast_activeStreamsOnRegistration,
1267 { "ActiveStreamsOnRegistration", "cast.activeStreamsOnRegistration",
1268 FT_UINT32, BASE_DEC, NULL, 0x0,
1269 "ActiveStreamsOnRegistration.",
1274 { "MaxBW", "cast.maxBW",
1275 FT_UINT32, BASE_DEC, NULL, 0x0,
1280 { &hf_cast_serviceResourceCount,
1281 { "ServiceResourceCount", "cast.serviceResourceCount",
1282 FT_UINT32, BASE_DEC, NULL, 0x0,
1283 "ServiceResourceCount.",
1287 { &hf_cast_layoutCount,
1288 { "LayoutCount", "cast.layoutCount",
1289 FT_UINT32, BASE_DEC, NULL, 0x0,
1295 { "Layout", "cast.layout",
1296 FT_UINT32, BASE_DEC, VALS(cast_Layouts), 0x0,
1301 { &hf_cast_maxConferences,
1302 { "MaxConferences", "cast.maxConferences",
1303 FT_UINT32, BASE_DEC, NULL, 0x0,
1308 { &hf_cast_activeConferenceOnRegistration,
1309 { "ActiveConferenceOnRegistration", "cast.activeConferenceOnRegistration",
1310 FT_UINT32, BASE_DEC, NULL, 0x0,
1311 "ActiveConferenceOnRegistration.",
1315 { &hf_cast_transmitOrReceive,
1316 { "TransmitOrReceive", "cast.transmitOrReceive",
1317 FT_UINT32, BASE_DEC, VALS(cast_transmitOrReceive), 0x0,
1318 "TransmitOrReceive",
1322 { &hf_cast_levelPreferenceCount,
1323 { "LevelPreferenceCount", "cast.levelPreferenceCount",
1324 FT_UINT32, BASE_DEC, NULL, 0x0,
1325 "LevelPreferenceCount.",
1329 { &hf_cast_transmitPreference,
1330 { "TransmitPreference", "cast.transmitPreference",
1331 FT_UINT32, BASE_DEC, NULL, 0x0,
1332 "TransmitPreference.",
1337 { "Format", "cast.format",
1338 FT_UINT32, BASE_DEC, VALS(cast_formatTypes), 0x0,
1343 { &hf_cast_maxBitRate,
1344 { "MaxBitRate", "cast.maxBitRate",
1345 FT_UINT32, BASE_DEC, NULL, 0x0,
1350 { &hf_cast_minBitRate,
1351 { "MinBitRate", "cast.minBitRate",
1352 FT_UINT32, BASE_DEC, NULL, 0x0,
1358 { "MPI", "cast.MPI",
1359 FT_UINT32, BASE_DEC, NULL, 0x0,
1364 { &hf_cast_serviceNumber,
1365 { "ServiceNumber", "cast.serviceNumber",
1366 FT_UINT32, BASE_DEC, NULL, 0x0,
1371 { &hf_cast_temporalSpatialTradeOffCapability,
1372 { "TemporalSpatialTradeOffCapability", "cast.temporalSpatialTradeOffCapability",
1373 FT_UINT32, BASE_DEC, NULL, 0x0,
1374 "TemporalSpatialTradeOffCapability.",
1378 { &hf_cast_stillImageTransmission,
1379 { "StillImageTransmission", "cast.stillImageTransmission",
1380 FT_UINT32, BASE_DEC, NULL, 0x0,
1381 "StillImageTransmission.",
1385 { &hf_cast_h263_capability_bitfield,
1386 { "H263_capability_bitfield", "cast.h263_capability_bitfield",
1387 FT_UINT32, BASE_DEC, NULL, 0x0,
1388 "H263_capability_bitfield.",
1392 { &hf_cast_annexNandWFutureUse,
1393 { "AnnexNandWFutureUse", "cast.annexNandWFutureUse",
1394 FT_UINT32, BASE_DEC, NULL, 0x0,
1395 "AnnexNandWFutureUse.",
1399 { &hf_cast_modelNumber,
1400 { "ModelNumber", "cast.modelNumber",
1401 FT_UINT32, BASE_DEC, NULL, 0x0,
1406 { &hf_cast_bandwidth,
1407 { "Bandwidth", "cast.bandwidth",
1408 FT_UINT32, BASE_DEC, NULL, 0x0,
1413 { &hf_cast_protocolDependentData,
1414 { "ProtocolDependentData", "cast.protocolDependentData",
1415 FT_UINT32, BASE_DEC, NULL, 0x0,
1416 "ProtocolDependentData.",
1420 { &hf_cast_DSCPValue,
1421 { "DSCPValue", "cast.DSCPValue",
1422 FT_UINT32, BASE_DEC, NULL, 0x0,
1427 { &hf_cast_serviceNum,
1428 { "ServiceNum", "cast.serviceNum",
1429 FT_UINT32, BASE_DEC, NULL, 0x0,
1434 { &hf_cast_precedenceValue,
1435 { "Precedence", "cast.precedenceValue",
1436 FT_UINT32, BASE_DEC, NULL, 0x0,
1441 { &hf_cast_maxStreams,
1442 { "MaxStreams", "cast.maxStreams",
1443 FT_UINT32, BASE_DEC, NULL, 0x0,
1444 "32 bit unsigned integer indicating the maximum number of simultansous RTP duplex streams that the client can handle.",
1448 { &hf_cast_millisecondPacketSize,
1449 { "MS/Packet", "cast.millisecondPacketSize",
1450 FT_UINT32, BASE_DEC, NULL, 0x0,
1451 "The number of milliseconds of conversation in each packet",
1455 { &hf_cast_echoCancelType,
1456 { "Echo Cancel Type", "cast.echoCancelType",
1457 FT_UINT32, BASE_DEC, VALS(cast_echoCancelTypes), 0x0,
1458 "Is echo cancelling enabled or not",
1462 { &hf_cast_g723BitRate,
1463 { "G723 BitRate", "cast.g723BitRate",
1464 FT_UINT32, BASE_DEC, VALS(cast_g723BitRates), 0x0,
1465 "The G723 bit rate for this stream/JUNK if not g723 stream",
1469 { &hf_cast_pictureFormatCount,
1470 { "PictureFormatCount", "cast.pictureFormatCount",
1471 FT_UINT32, BASE_DEC, NULL, 0x0,
1472 "PictureFormatCount.",
1476 { &hf_cast_confServiceNum,
1477 { "ConfServiceNum", "cast.confServiceNum",
1478 FT_UINT32, BASE_DEC, NULL, 0x0,
1483 { &hf_cast_miscCommandType,
1484 { "MiscCommandType", "cast.miscCommandType",
1485 FT_UINT32, BASE_DEC, VALS(cast_miscCommandType), 0x0,
1490 { &hf_cast_temporalSpatialTradeOff,
1491 { "TemporalSpatialTradeOff", "cast.temporalSpatialTradeOff",
1492 FT_UINT32, BASE_DEC, NULL, 0x0,
1493 "TemporalSpatialTradeOff.",
1497 { &hf_cast_firstGOB,
1498 { "FirstGOB", "cast.firstGOB",
1499 FT_UINT32, BASE_DEC, NULL, 0x0,
1504 { &hf_cast_numberOfGOBs,
1505 { "NumberOfGOBs", "cast.numberOfGOBs",
1506 FT_UINT32, BASE_DEC, NULL, 0x0,
1512 { "FirstMB", "cast.firstMB",
1513 FT_UINT32, BASE_DEC, NULL, 0x0,
1518 { &hf_cast_numberOfMBs,
1519 { "NumberOfMBs", "cast.numberOfMBs",
1520 FT_UINT32, BASE_DEC, NULL, 0x0,
1525 { &hf_cast_pictureNumber,
1526 { "PictureNumber", "cast.pictureNumber",
1527 FT_UINT32, BASE_DEC, NULL, 0x0,
1532 { &hf_cast_longTermPictureIndex,
1533 { "LongTermPictureIndex", "cast.longTermPictureIndex",
1534 FT_UINT32, BASE_DEC, NULL, 0x0,
1535 "LongTermPictureIndex.",
1539 { &hf_cast_recoveryReferencePictureCount,
1540 { "RecoveryReferencePictureCount", "cast.recoveryReferencePictureCount",
1541 FT_UINT32, BASE_DEC, NULL, 0x0,
1542 "RecoveryReferencePictureCount.",
1546 { &hf_cast_calledParty,
1547 { "CalledParty", "cast.calledParty",
1548 FT_STRING, BASE_NONE, NULL, 0x0,
1549 "The number called.",
1554 { "Privacy", "cast.privacy",
1555 FT_UINT32, BASE_DEC, NULL, 0x0,
1560 { &hf_cast_precedenceLv,
1561 { "PrecedenceLv", "cast.precedenceLv",
1562 FT_UINT32, BASE_DEC, NULL, 0x0,
1563 "Precedence Level.",
1567 { &hf_cast_precedenceDm,
1568 { "PrecedenceDm", "cast.precedenceDm",
1569 FT_UINT32, BASE_DEC, NULL, 0x0,
1570 "Precedence Domain.",
1574 { &hf_cast_callState,
1575 { "CallState", "cast.callState",
1576 FT_UINT32, BASE_DEC, VALS(cast_callStateTypes), 0x0,
1581 { &hf_cast_callingPartyName,
1582 { "Calling Party Name", "cast.callingPartyName",
1583 FT_STRING, BASE_NONE, NULL, 0x0,
1584 "The passed name of the calling party.",
1588 { &hf_cast_callingParty,
1589 { "Calling Party", "cast.callingPartyName",
1590 FT_STRING, BASE_NONE, NULL, 0x0,
1591 "The passed number of the calling party.",
1595 { &hf_cast_calledPartyName,
1596 { "Called Party Name", "cast.calledPartyName",
1597 FT_STRING, BASE_NONE, NULL, 0x0,
1598 "The name of the party we are calling.",
1602 { &hf_cast_callType,
1603 { "Call Type", "cast.callType",
1604 FT_UINT32, BASE_DEC, VALS(cast_callTypes), 0x0,
1605 "What type of call, in/out/etc",
1609 { &hf_cast_originalCalledPartyName,
1610 { "Original Called Party Name", "cast.originalCalledPartyName",
1611 FT_STRING, BASE_NONE, NULL, 0x0,
1612 "name of the original person who placed the call.",
1616 { &hf_cast_originalCalledParty,
1617 { "Original Called Party", "cast.originalCalledParty",
1618 FT_STRING, BASE_NONE, NULL, 0x0,
1619 "The number of the original calling party.",
1623 { &hf_cast_lastRedirectingPartyName,
1624 { "LastRedirectingPartyName", "cast.lastRedirectingPartyName",
1625 FT_STRING, BASE_NONE, NULL, 0x0,
1626 "LastRedirectingPartyName.",
1630 { &hf_cast_lastRedirectingParty,
1631 { "LastRedirectingParty", "cast.lastRedirectingParty",
1632 FT_STRING, BASE_NONE, NULL, 0x0,
1633 "LastRedirectingParty.",
1637 { &hf_cast_cgpnVoiceMailbox,
1638 { "CgpnVoiceMailbox", "cast.cgpnVoiceMailbox",
1639 FT_STRING, BASE_NONE, NULL, 0x0,
1640 "CgpnVoiceMailbox.",
1644 { &hf_cast_cdpnVoiceMailbox,
1645 { "CdpnVoiceMailbox", "cast.cdpnVoiceMailbox",
1646 FT_STRING, BASE_NONE, NULL, 0x0,
1647 "CdpnVoiceMailbox.",
1651 { &hf_cast_originalCdpnVoiceMailbox,
1652 { "OriginalCdpnVoiceMailbox", "cast.originalCdpnVoiceMailbox",
1653 FT_STRING, BASE_NONE, NULL, 0x0,
1654 "OriginalCdpnVoiceMailbox.",
1658 { &hf_cast_lastRedirectingVoiceMailbox,
1659 { "LastRedirectingVoiceMailbox", "cast.lastRedirectingVoiceMailbox",
1660 FT_STRING, BASE_NONE, NULL, 0x0,
1661 "LastRedirectingVoiceMailbox.",
1665 { &hf_cast_originalCdpnRedirectReason,
1666 { "OriginalCdpnRedirectReason", "cast.originalCdpnRedirectReason",
1667 FT_UINT32, BASE_DEC, NULL, 0x0,
1668 "OriginalCdpnRedirectReason.",
1672 { &hf_cast_lastRedirectingReason,
1673 { "LastRedirectingReason", "cast.lastRedirectingReason",
1674 FT_UINT32, BASE_DEC, NULL, 0x0,
1675 "LastRedirectingReason.",
1679 { &hf_cast_callInstance,
1680 { "CallInstance", "cast.callInstance",
1681 FT_UINT32, BASE_DEC, NULL, 0x0,
1686 { &hf_cast_callSecurityStatus,
1687 { "CallSecurityStatus", "cast.callSecurityStatus",
1688 FT_UINT32, BASE_DEC, VALS(cast_callSecurityStatusTypes), 0x0,
1689 "CallSecurityStatus.",
1693 { &hf_cast_directoryNumber,
1694 { "Directory Number", "cast.directoryNumber",
1695 FT_STRING, BASE_NONE, NULL, 0x0,
1696 "The number we are reporting statistics for.",
1700 { &hf_cast_requestorIpAddress,
1701 { "RequestorIpAddress", "cast.requestorIpAddress",
1702 FT_IPv4, BASE_NONE, NULL, 0x0,
1703 "RequestorIpAddress",
1707 { &hf_cast_stationIpAddress,
1708 { "StationIpAddress", "cast.stationIpAddress",
1709 FT_IPv4, BASE_NONE, NULL, 0x0,
1714 { &hf_cast_stationFriendlyName,
1715 { "StationFriendlyName", "cast.stationFriendlyName",
1716 FT_STRING, BASE_NONE, NULL, 0x0,
1717 "StationFriendlyName.",
1721 { &hf_cast_stationGUID,
1722 { "stationGUID", "cast.stationGUID",
1723 FT_STRING, BASE_NONE, NULL, 0x0,
1729 { "AudioCodec", "cast.audio",
1730 FT_UINT32, BASE_DEC, VALS(audioCodecTypes), 0x0,
1731 "The audio codec that is in use.",
1736 { "BitRate", "skinny.bitRate",
1737 FT_UINT32, BASE_DEC, NULL, 0x0,
1744 /* Setup protocol subtree array */
1745 static gint *ett[] = {
1750 module_t *cast_module;
1752 /* Register the protocol name and description */
1753 proto_cast = proto_register_protocol("Cast Client Control Protocol",
1756 /* Required function calls to register the header fields and subtrees used */
1757 proto_register_field_array(proto_cast, hf, array_length(hf));
1758 proto_register_subtree_array(ett, array_length(ett));
1760 cast_module = prefs_register_protocol(proto_cast, NULL);
1761 prefs_register_bool_preference(cast_module, "reassembly", /*"desegment",*/
1762 "Desegment all CAST messages spanning multiple TCP segments",
1763 "Whether the CAST dissector should desegment all messages spanning multiple TCP segments",
1768 proto_reg_handoff_cast(void)
1770 dissector_handle_t cast_handle;
1772 data_handle = find_dissector("data");
1773 cast_handle = create_dissector_handle(dissect_cast, proto_cast);
1774 dissector_add("tcp.port", TCP_PORT_CAST, cast_handle);