diff --git a/epan/dissectors/packet-skinny.c b/epan/dissectors/packet-skinny.c index 0851910f73..69f1eaf1e8 100644 --- a/epan/dissectors/packet-skinny.c +++ b/epan/dissectors/packet-skinny.c @@ -46,6 +46,9 @@ #include #include +#include +#include +#include #include #include #include @@ -55,6 +58,10 @@ #include "packet-ssl.h" #include "packet-skinny.h" +/* un-comment the following as well as this line in conversation.c, to enable debug printing */ +/* #define DEBUG_CONVERSATION */ +#include "conversation_debug.h" + void proto_register_skinny(void); void proto_reg_handoff_skinny(void); @@ -89,9 +96,9 @@ static const value_string header_version[] = { }; /* Declare MessageId */ -static const value_string message_id[] = { - { 0x0000, "KeepAlive" }, - { 0x0001, "Register" }, +static const value_string message_id[] = { + { 0x0000, "KeepAliveReq" }, + { 0x0001, "RegisterReq" }, { 0x0002, "IpPort" }, { 0x0003, "KeypadButton" }, { 0x0004, "EnblocCall" }, @@ -115,7 +122,7 @@ static const value_string message_id[] = { { 0x0024, "OffHookWithCgpn" }, { 0x0025, "SoftKeySetReq" }, { 0x0026, "SoftKeyEvent" }, - { 0x0027, "Unregister" }, + { 0x0027, "UnregisterReq" }, { 0x0028, "SoftKeyTemplateReq" }, { 0x0029, "RegisterTokenReq" }, { 0x002a, "MediaTransmissionFailure" }, @@ -137,8 +144,8 @@ static const value_string message_id[] = { { 0x0040, "AuditParticipantRes" }, { 0x0041, "DeviceToUserDataVersion1" }, { 0x0042, "DeviceToUserDataResponseVersion1" }, - { 0x0043, "UpdateCapabilitiesV2" }, - { 0x0044, "UpdateCapabilitiesV3" }, + { 0x0043, "CapabilitiesV2Res" }, + { 0x0044, "CapabilitiesV3Res" }, { 0x0045, "PortRes" }, { 0x0046, "QoSResvNotify" }, { 0x0047, "QoSErrorNotify" }, @@ -156,15 +163,15 @@ static const value_string message_id[] = { { 0x008a, "StartMediaTransmission" }, { 0x008b, "StopMediaTransmission" }, { 0x008f, "CallInfo" }, - { 0x0090, "ForwardStat" }, - { 0x0091, "SpeedDialStat" }, - { 0x0092, "LineStat" }, - { 0x0093, "ConfigStat" }, - { 0x0094, "DefineTimeDate" }, + { 0x0090, "ForwardStatRes" }, + { 0x0091, "SpeedDialStatRes" }, + { 0x0092, "LineStatRes" }, + { 0x0093, "ConfigStatRes" }, + { 0x0094, "TimeDateRes" }, { 0x0095, "StartSessionTransmission" }, { 0x0096, "StopSessionTransmission" }, - { 0x0097, "ButtonTemplate" }, - { 0x0098, "Version" }, + { 0x0097, "ButtonTemplateRes" }, + { 0x0098, "VersionRes" }, { 0x0099, "DisplayText" }, { 0x009a, "ClearDisplay" }, { 0x009b, "CapabilitiesReq" }, @@ -190,13 +197,13 @@ static const value_string message_id[] = { { 0x0116, "ActivateCallPlane" }, { 0x0117, "DeactivateCallPlane" }, { 0x0118, "UnregisterAck" }, - { 0x0119, "BackSpaceReq" }, + { 0x0119, "BackSpaceRes" }, { 0x011a, "RegisterTokenAck" }, { 0x011b, "RegisterTokenReject" }, { 0x011c, "StartMediaFailureDetection" }, { 0x011d, "DialedNumber" }, { 0x011e, "UserToDeviceData" }, - { 0x011f, "FeatureStat" }, + { 0x011f, "FeatureStatRes" }, { 0x0120, "DisplayPriNotify" }, { 0x0121, "ClearPriNotify" }, { 0x0122, "StartAnnouncement" }, @@ -210,8 +217,8 @@ static const value_string message_id[] = { { 0x012c, "UnSubscribeDtmfPayloadReq" }, { 0x012d, "UnSubscribeDtmfPayloadRes" }, { 0x012e, "UnSubscribeDtmfPayloadErr" }, - { 0x012f, "ServiceURLStat" }, - { 0x0130, "CallSelectStat" }, + { 0x012f, "ServiceURLStatRes" }, + { 0x0130, "CallSelectStatRes" }, { 0x0131, "OpenMultiMediaReceiveChannel" }, { 0x0132, "StartMultiMediaTransmission" }, { 0x0133, "StopMultiMediaTransmission" }, @@ -229,14 +236,14 @@ static const value_string message_id[] = { { 0x013f, "UserToDeviceDataVersion1" }, { 0x0140, "VideoDisplayCommand" }, { 0x0141, "FlowControlNotify" }, - { 0x0142, "ConfigStatV2" }, + { 0x0142, "ConfigStatV2Res" }, { 0x0143, "DisplayNotifyV2" }, { 0x0144, "DisplayPriNotifyV2" }, { 0x0145, "DisplayPromptStatusV2" }, - { 0x0146, "FeatureStatV2" }, - { 0x0147, "LineStatV2" }, - { 0x0148, "ServiceURLStatV2" }, - { 0x0149, "SpeedDialStatV2" }, + { 0x0146, "FeatureStatV2Res" }, + { 0x0147, "LineStatV2Res" }, + { 0x0148, "ServiceURLStatV2Res" }, + { 0x0149, "SpeedDialStatV2Res" }, { 0x014a, "CallInfoV2" }, { 0x014b, "PortReq" }, { 0x014c, "PortClose" }, @@ -245,13 +252,13 @@ static const value_string message_id[] = { { 0x014f, "QoSTeardown" }, { 0x0150, "UpdateDSCP" }, { 0x0151, "QoSModify" }, - { 0x0152, "SubscriptionStat" }, + { 0x0152, "SubscriptionStatRes" }, { 0x0153, "Notification" }, { 0x0154, "StartMediaTransmissionAck" }, { 0x0155, "StartMultiMediaTransmissionAck" }, { 0x0156, "CallHistoryInfo" }, - { 0x0156, "LocationInfo" }, - { 0x0158, "MwiResponse" }, + { 0x0157, "LocationInfo" }, + { 0x0158, "MwiRes" }, { 0x0159, "AddOnDeviceCapabilities" }, { 0x015a, "EnhancedAlarm" }, { 0x015e, "CallCountReq" }, @@ -264,7 +271,6 @@ static const value_string message_id[] = { }; static value_string_ext message_id_ext = VALUE_STRING_EXT_INIT(message_id); - /* Declare Enums and Defines */ static const value_string DisplayLabels_36[] = { { 0x00000, "Empty" }, @@ -1731,6 +1737,9 @@ static int hf_skinny_data_length = -1; static int hf_skinny_hdr_version = -1; static int hf_skinny_xmlData = -1; static int hf_skinny_ipv4or6 = -1; +static int hf_skinny_response_in = -1; +static int hf_skinny_response_to = -1; +static int hf_skinny_response_time = -1; static int hf_skinny_AlternateCallingParty = -1; static int hf_skinny_CallingPartyName = -1; @@ -2015,6 +2024,7 @@ static int hf_skinny_mwiTargetNumber = -1; static int hf_skinny_mwi_notification_result = -1; static int hf_skinny_noaudio = -1; static int hf_skinny_none = -1; +static int hf_skinny_notificationStatus = -1; static int hf_skinny_notify = -1; static int hf_skinny_nse = -1; static int hf_skinny_numNewMsgs = -1; @@ -2045,7 +2055,7 @@ static int hf_skinny_participantName = -1; static int hf_skinny_participantNumber = -1; static int hf_skinny_partyDirection = -1; static int hf_skinny_passThruData = -1; -static int hf_skinny_passThruPartyID = -1; +static int hf_skinny_passThruPartyId = -1; static int hf_skinny_passthruPartyID = -1; static int hf_skinny_payloadCapability = -1; static int hf_skinny_payloadDtmf = -1; @@ -2139,7 +2149,6 @@ static int hf_skinny_subAppID = -1; static int hf_skinny_subcriptionFeatureID = -1; static int hf_skinny_subscriptionFeatureID = -1; static int hf_skinny_subscriptionID = -1; -static int hf_skinny_subscriptionoFeatureID = -1; static int hf_skinny_systemTime = -1; static int hf_skinny_temporalSpatialTradeOff = -1; static int hf_skinny_temporalSpatialTradeOffCapability = -1; @@ -2323,17 +2332,79 @@ dissect_skinny_displayLabel(ptvcursor_t *cursor, int hfindex, gint length) ptvcursor_advance(cursor, length); } -/*** Messages Handlers ***/ +/*** Request / Response helper functions */ +static void skinny_reqrep_add_request(ptvcursor_t *cursor, packet_info * pinfo, skinny_conv_info_t * skinny_conv, const int request_key) +{ + proto_tree *tree = ptvcursor_tree(cursor); + tvbuff_t *tvb = ptvcursor_tvbuff(cursor); + skinny_req_resp_t *req_resp = NULL; + if (!PINFO_FD_VISITED(pinfo)) { + req_resp = wmem_new0(wmem_file_scope(), skinny_req_resp_t); + req_resp->request_frame = pinfo->num; + req_resp->response_frame = 0; + req_resp->request_time = pinfo->fd->abs_ts; + wmem_map_insert(skinny_conv->pending_req_resp, GINT_TO_POINTER(request_key), (void *)req_resp); + DPRINT(("SKINNY: setup_request: frame=%d add key=%d to map\n", pinfo->num, request_key)); + } + + req_resp = (skinny_req_resp_t *) wmem_map_lookup(skinny_conv->requests, GUINT_TO_POINTER(pinfo->num)); + if (req_resp && req_resp->response_frame) { + DPRINT(("SKINNY: show request in tree: frame/key=%d\n", pinfo->num)); + proto_item *it; + it = proto_tree_add_uint(tree, hf_skinny_response_in, tvb, 0, 0, req_resp->response_frame); + PROTO_ITEM_SET_GENERATED(it); + } else { + DPRINT(("SKINNY: no request found for frame/key=%d\n", pinfo->num)); + } +} + + +static void skinny_reqrep_add_response(ptvcursor_t *cursor, packet_info * pinfo, skinny_conv_info_t * skinny_conv, const int request_key) +{ + proto_tree *tree = ptvcursor_tree(cursor); + tvbuff_t *tvb = ptvcursor_tvbuff(cursor); + skinny_req_resp_t *req_resp = NULL; + + if (!PINFO_FD_VISITED(pinfo)) { + req_resp = (skinny_req_resp_t *) wmem_map_remove(skinny_conv->pending_req_resp, GINT_TO_POINTER(request_key)); + if (req_resp) { + DPRINT(("SKINNY: match request:%d with response:%d for key=%d\n", req_resp->request_frame, pinfo->num, request_key)); + req_resp->response_frame = pinfo->num; + wmem_map_insert(skinny_conv->requests, GUINT_TO_POINTER(req_resp->request_frame), (void *)req_resp); + wmem_map_insert(skinny_conv->responses, GUINT_TO_POINTER(pinfo->num), (void *)req_resp); + } else { + DPRINT(("SKINNY: no match found for reponse frame=%d and key=%d\n", pinfo->num, request_key)); + } + } + + req_resp = (skinny_req_resp_t *) wmem_map_lookup(skinny_conv->responses, GUINT_TO_POINTER(pinfo->num)); + if (req_resp && req_resp->request_frame) { + DPRINT(("SKINNY: show response in tree: frame/key=%d\n", pinfo->num)); + proto_item *it; + nstime_t ns; + it = proto_tree_add_uint(tree, hf_skinny_response_to, tvb, 0, 0, req_resp->request_frame); + PROTO_ITEM_SET_GENERATED(it); + + nstime_delta(&ns, &pinfo->fd->abs_ts, &req_resp->request_time); + it = proto_tree_add_time(tree, hf_skinny_response_time, tvb, 0, 0, &ns); + PROTO_ITEM_SET_GENERATED(it); + } else { + DPRINT(("SKINNY: no response found for frame/key=%d\n", pinfo->num)); + } +} + +/*** Messages Handlers ***/ /* - * Message: RegisterMessage + * Message: RegisterReqMessage * Opcode: 0x0001 * Type: RegistrationAndManagement * Direction: dev2pbx * VarLength: no + * MsgType: request */ static void -handle_RegisterMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_RegisterReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 hdr_data_length = tvb_get_letohl(ptvcursor_tvbuff(cursor), 0); @@ -2385,6 +2456,7 @@ handle_RegisterMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) if (hdr_data_length > 191) { ptvcursor_add(cursor, hf_skinny_configVersionStamp, 48, ENC_ASCII|ENC_NA); } + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x0001); } /* @@ -2393,9 +2465,10 @@ handle_RegisterMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: dev2pbx * VarLength: no + * MsgType: event */ static void -handle_IpPortMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_IpPortMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_rtpMediaPort, 4, ENC_LITTLE_ENDIAN); } @@ -2406,9 +2479,10 @@ handle_IpPortMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: dev2pbx * VarLength: no + * MsgType: event */ static void -handle_KeypadButtonMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_KeypadButtonMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 hdr_data_length = tvb_get_letohl(ptvcursor_tvbuff(cursor), 0); @@ -2427,9 +2501,10 @@ handle_KeypadButtonMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: dev2pbx * VarLength: no + * MsgType: event */ static void -handle_EnblocCallMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_EnblocCallMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 hdr_data_length = tvb_get_letohl(ptvcursor_tvbuff(cursor), 0); guint32 hdr_version = tvb_get_letohl(ptvcursor_tvbuff(cursor), 4); @@ -2449,9 +2524,10 @@ handle_EnblocCallMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: dev2pbx * VarLength: no + * MsgType: event */ static void -handle_StimulusMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_StimulusMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_stimulus, 4, ENC_LITTLE_ENDIAN); si->lineId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); @@ -2467,9 +2543,10 @@ handle_StimulusMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: dev2pbx * VarLength: no + * MsgType: event */ static void -handle_OffHookMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_OffHookMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 hdr_data_length = tvb_get_letohl(ptvcursor_tvbuff(cursor), 0); @@ -2487,9 +2564,10 @@ handle_OffHookMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: dev2pbx * VarLength: no + * MsgType: event */ static void -handle_OnHookMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_OnHookMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 hdr_data_length = tvb_get_letohl(ptvcursor_tvbuff(cursor), 0); @@ -2507,9 +2585,10 @@ handle_OnHookMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: dev2pbx * VarLength: no + * MsgType: event */ static void -handle_HookFlashMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_HookFlashMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { si->lineId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_lineInstance, 4, ENC_LITTLE_ENDIAN); @@ -2523,11 +2602,15 @@ handle_HookFlashMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: dev2pbx * VarLength: no + * MsgType: request */ static void -handle_ForwardStatReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_ForwardStatReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 lineNumber = 0; + lineNumber = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_lineNumber, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x0009 ^ lineNumber); } /* @@ -2536,11 +2619,15 @@ handle_ForwardStatReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: dev2pbx * VarLength: no + * MsgType: request */ static void -handle_SpeedDialStatReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_SpeedDialStatReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 speedDialNumber = 0; + speedDialNumber = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_speedDialNumber, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x000a ^ speedDialNumber); } /* @@ -2549,22 +2636,27 @@ handle_SpeedDialStatReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: dev2pbx * VarLength: no + * MsgType: request */ static void -handle_LineStatReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_LineStatReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 lineNumber = 0; + lineNumber = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_lineNumber, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x000b ^ lineNumber); } /* - * Message: CapabilitiesRes + * Message: CapabilitiesResMessage * Opcode: 0x0010 * Type: RegistrationAndManagement * Direction: dev2pbx * VarLength: no + * MsgType: response */ static void -handle_CapabilitiesRes(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_CapabilitiesResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 capCount = 0; guint32 payloadCapability = 0; @@ -2637,6 +2729,7 @@ handle_CapabilitiesRes(ptvcursor_t *cursor, packet_info * pinfo _U_) } else { ptvcursor_advance(cursor, (capCount * 16)); /* guard kicked in -> skip the rest */; } + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x009b); } /* @@ -2645,9 +2738,10 @@ handle_CapabilitiesRes(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: dev2pbx * VarLength: no + * MsgType: event */ static void -handle_AlarmMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_AlarmMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_alarmSeverity, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_text, 80, ENC_ASCII|ENC_NA); @@ -2661,15 +2755,20 @@ handle_AlarmMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: MediaControl * Direction: dev2pbx * VarLength: no + * MsgType: response */ static void -handle_MulticastMediaReceptionAckMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_MulticastMediaReceptionAckMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 passThruPartyId = 0; si->multicastReceptionStatus = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_multicastReceptionStatus, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + passThruPartyId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0101 ^ passThruPartyId); } /* @@ -2678,21 +2777,26 @@ handle_MulticastMediaReceptionAckMessage(ptvcursor_t *cursor, packet_info * pinf * Type: MediaControl * Direction: dev2pbx * VarLength: no + * MsgType: response */ static void -handle_OpenReceiveChannelAckMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_OpenReceiveChannelAckMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 hdr_data_length = tvb_get_letohl(ptvcursor_tvbuff(cursor), 0); + guint32 passThruPartyId = 0; si->mediaReceptionStatus = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_mediaReceptionStatus, 4, ENC_LITTLE_ENDIAN); dissect_skinny_ipv4or6(cursor, hf_skinny_ipAddr_ipv4, hf_skinny_ipAddr_ipv6); ptvcursor_add(cursor, hf_skinny_portNumber, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + passThruPartyId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); if (hdr_data_length > 20) { si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); } + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0105 ^ passThruPartyId); } /* @@ -2701,28 +2805,33 @@ handle_OpenReceiveChannelAckMessage(ptvcursor_t *cursor, packet_info * pinfo _U_ * Type: CallControl * Direction: dev2pbx * VarLength: no + * MsgType: response */ static void -handle_ConnectionStatisticsResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_ConnectionStatisticsResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 hdr_data_length = tvb_get_letohl(ptvcursor_tvbuff(cursor), 0); guint32 hdr_version = tvb_get_letohl(ptvcursor_tvbuff(cursor), 4); + guint32 callReference = 0; guint32 dataSize = 0; if (hdr_version <= V16_MSG_TYPE) { ptvcursor_add(cursor, hf_skinny_directoryNum, 24, ENC_ASCII|ENC_NA); + callReference = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_statsProcessingMode, 4, ENC_LITTLE_ENDIAN); } if (hdr_version >= V17_MSG_TYPE && hdr_version <= V20_MSG_TYPE) { ptvcursor_add(cursor, hf_skinny_directoryNum, 28, ENC_ASCII|ENC_NA); + callReference = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_statsProcessingMode, 4, ENC_LITTLE_ENDIAN); } if (hdr_version >= V21_MSG_TYPE) { ptvcursor_add(cursor, hf_skinny_directoryNum, 28, ENC_ASCII|ENC_NA); + callReference = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_statsProcessingMode, 1, ENC_LITTLE_ENDIAN); @@ -2739,6 +2848,7 @@ handle_ConnectionStatisticsResMessage(ptvcursor_t *cursor, packet_info * pinfo _ ptvcursor_add(cursor, hf_skinny_dataSize, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_data, dataSize, ENC_ASCII|ENC_NA); } + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0107 ^ callReference); } /* @@ -2747,9 +2857,10 @@ handle_ConnectionStatisticsResMessage(ptvcursor_t *cursor, packet_info * pinfo _ * Type: CallControl * Direction: dev2pbx * VarLength: no + * MsgType: event */ static void -handle_OffHookWithCgpnMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_OffHookWithCgpnMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 hdr_version = tvb_get_letohl(ptvcursor_tvbuff(cursor), 4); guint32 VariableDirnumSize = (hdr_version >= V18_MSG_TYPE) ? 25 : 24; @@ -2765,9 +2876,10 @@ handle_OffHookWithCgpnMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: dev2pbx * VarLength: no + * MsgType: event */ static void -handle_SoftKeyEventMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_SoftKeyEventMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_softKeyEvent, 4, ENC_LITTLE_ENDIAN); si->lineId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); @@ -2777,20 +2889,22 @@ handle_SoftKeyEventMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) } /* - * Message: UnregisterMessage + * Message: UnregisterReqMessage * Opcode: 0x0027 * Type: RegistrationAndManagement * Direction: dev2pbx * VarLength: no + * MsgType: request */ static void -handle_UnregisterMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_UnregisterReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 hdr_data_length = tvb_get_letohl(ptvcursor_tvbuff(cursor), 0); if (hdr_data_length > 12) { ptvcursor_add(cursor, hf_skinny_unRegReasonCode, 4, ENC_LITTLE_ENDIAN); } + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x0027); } /* @@ -2799,9 +2913,10 @@ handle_UnregisterMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: dev2pbx * VarLength: no + * MsgType: request */ static void -handle_RegisterTokenReq(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_RegisterTokenReq(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { { ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH, ett_skinny_tree, "sid"); @@ -2813,6 +2928,7 @@ handle_RegisterTokenReq(ptvcursor_t *cursor, packet_info * pinfo _U_) ptvcursor_add(cursor, hf_skinny_stationIpAddr, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_deviceType, 4, ENC_LITTLE_ENDIAN); dissect_skinny_ipv4or6(cursor, hf_skinny_stationIpV6Addr_ipv4, hf_skinny_stationIpV6Addr_ipv6); + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x0029); } /* @@ -2821,16 +2937,21 @@ handle_RegisterTokenReq(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: MediaControl * Direction: dev2pbx * VarLength: no + * MsgType: response */ static void -handle_MediaTransmissionFailureMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_MediaTransmissionFailureMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 passThruPartyId = 0; ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + passThruPartyId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); dissect_skinny_ipv4or6(cursor, hf_skinny_remoteIpAddr_ipv4, hf_skinny_remoteIpAddr_ipv6); ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x008a ^ passThruPartyId); } /* @@ -2839,9 +2960,10 @@ handle_MediaTransmissionFailureMessage(ptvcursor_t *cursor, packet_info * pinfo * Type: CallControl * Direction: dev2pbx * VarLength: no + * MsgType: event */ static void -handle_HeadsetStatusMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_HeadsetStatusMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_headsetStatus, 4, ENC_LITTLE_ENDIAN); } @@ -2852,9 +2974,10 @@ handle_HeadsetStatusMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: MediaControl * Direction: dev2pbx * VarLength: no + * MsgType: event */ static void -handle_MediaResourceNotificationMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_MediaResourceNotificationMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_deviceType, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_numberOfInServiceStreams, 4, ENC_LITTLE_ENDIAN); @@ -2868,9 +2991,10 @@ handle_MediaResourceNotificationMessage(ptvcursor_t *cursor, packet_info * pinfo * Type: RegistrationAndManagement * Direction: dev2pbx * VarLength: no + * MsgType: event */ static void -handle_RegisterAvailableLinesMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_RegisterAvailableLinesMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_maxNumOfAvailLines, 4, ENC_LITTLE_ENDIAN); } @@ -2881,9 +3005,10 @@ handle_RegisterAvailableLinesMessage(ptvcursor_t *cursor, packet_info * pinfo _U * Type: RegistrationAndManagement * Direction: dev2pbx * VarLength: no + * MsgType: request */ static void -handle_DeviceToUserDataMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_DeviceToUserDataMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 dataLength = 0; { @@ -2899,6 +3024,7 @@ handle_DeviceToUserDataMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) dissect_skinny_xml(cursor, hf_skinny_xmldata, pinfo, dataLength, 2000); ptvcursor_pop_subtree(cursor); } + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x002e); } /* @@ -2907,9 +3033,10 @@ handle_DeviceToUserDataMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: dev2pbx * VarLength: no + * MsgType: response */ static void -handle_DeviceToUserDataResponseMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_DeviceToUserDataResponseMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 dataLength = 0; { @@ -2925,6 +3052,7 @@ handle_DeviceToUserDataResponseMessage(ptvcursor_t *cursor, packet_info * pinfo dissect_skinny_xml(cursor, hf_skinny_xmldata, pinfo, dataLength, 2000); ptvcursor_pop_subtree(cursor); } + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x002e); } /* @@ -2933,9 +3061,10 @@ handle_DeviceToUserDataResponseMessage(ptvcursor_t *cursor, packet_info * pinfo * Type: RegistrationAndManagement * Direction: dev2pbx * VarLength: no + * MsgType: event */ static void -handle_UpdateCapabilitiesMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_UpdateCapabilitiesMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 audioCapCount = 0; guint32 videoCapCount = 0; @@ -3224,23 +3353,22 @@ handle_UpdateCapabilitiesMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: MediaControl * Direction: dev2pbx * VarLength: no + * MsgType: response */ static void -handle_OpenMultiMediaReceiveChannelAckMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_OpenMultiMediaReceiveChannelAckMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { - guint32 hdr_version = tvb_get_letohl(ptvcursor_tvbuff(cursor), 4); - + guint32 passThruPartyId = 0; si->multimediaReceptionStatus = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_multimediaReceptionStatus, 4, ENC_LITTLE_ENDIAN); dissect_skinny_ipv4or6(cursor, hf_skinny_ipAddr_ipv4, hf_skinny_ipAddr_ipv6); ptvcursor_add(cursor, hf_skinny_portNumber, 4, ENC_LITTLE_ENDIAN); + passThruPartyId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); - if (hdr_version >= V16_MSG_TYPE) { - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); - si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); - ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); - } + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0131 ^ passThruPartyId); } /* @@ -3249,9 +3377,10 @@ handle_OpenMultiMediaReceiveChannelAckMessage(ptvcursor_t *cursor, packet_info * * Type: Conference * Direction: dev2pbx * VarLength: no + * MsgType: event */ static void -handle_ClearConferenceMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_ClearConferenceMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_serviceNum, 4, ENC_LITTLE_ENDIAN); @@ -3263,11 +3392,15 @@ handle_ClearConferenceMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: dev2pbx * VarLength: no + * MsgType: request */ static void -handle_ServiceURLStatReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_ServiceURLStatReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 serviceURLIndex = 0; + serviceURLIndex = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_serviceURLIndex, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x0033 ^ serviceURLIndex); } /* @@ -3276,16 +3409,20 @@ handle_ServiceURLStatReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: dev2pbx * VarLength: no + * MsgType: request */ static void -handle_FeatureStatReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_FeatureStatReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 hdr_data_length = tvb_get_letohl(ptvcursor_tvbuff(cursor), 0); + guint32 featureIndex = 0; + featureIndex = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_featureIndex, 4, ENC_LITTLE_ENDIAN); if (hdr_data_length > 16) { ptvcursor_add(cursor, hf_skinny_featureCapabilities, 4, ENC_LITTLE_ENDIAN); } + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x0034 ^ featureIndex); } /* @@ -3294,16 +3431,20 @@ handle_FeatureStatReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: response */ static void -handle_CreateConferenceResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_CreateConferenceResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 conferenceID = 0; guint32 dataLength = 0; + conferenceID = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_result, 4, ENC_LITTLE_ENDIAN); dataLength = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_dataLength, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_passThruData, dataLength, ENC_ASCII|ENC_NA); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0137 ^ conferenceID); } /* @@ -3312,12 +3453,16 @@ handle_CreateConferenceResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: response */ static void -handle_DeleteConferenceResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_DeleteConferenceResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 conferenceID = 0; + conferenceID = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_delete_conf_result, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0138 ^ conferenceID); } /* @@ -3326,16 +3471,20 @@ handle_DeleteConferenceResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: response */ static void -handle_ModifyConferenceResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_ModifyConferenceResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 conferenceID = 0; guint32 dataLength = 0; + conferenceID = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_modify_conf_result, 4, ENC_LITTLE_ENDIAN); dataLength = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_dataLength, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_passThruData, dataLength, ENC_ASCII|ENC_NA); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0139 ^ conferenceID); } /* @@ -3344,15 +3493,19 @@ handle_ModifyConferenceResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: response */ static void -handle_AddParticipantResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_AddParticipantResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 conferenceID = 0; + conferenceID = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_add_participant_result, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_bridgeParticipantId, 257, ENC_ASCII|ENC_NA); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x013a ^ conferenceID); } /* @@ -3361,9 +3514,10 @@ handle_AddParticipantResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: response */ static void -handle_AuditConferenceResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_AuditConferenceResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 numberOfEntries = 0; ptvcursor_add(cursor, hf_skinny_last, 4, ENC_LITTLE_ENDIAN); @@ -3393,6 +3547,7 @@ handle_AuditConferenceResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) } else { ptvcursor_advance(cursor, (numberOfEntries * 76)); /* guard kicked in -> skip the rest */; } + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x013c); } /* @@ -3401,13 +3556,16 @@ handle_AuditConferenceResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: response */ static void -handle_AuditParticipantResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_AuditParticipantResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 conferenceID = 0; guint32 numberOfEntries = 0; ptvcursor_add(cursor, hf_skinny_audit_participant_result, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_last, 4, ENC_LITTLE_ENDIAN); + conferenceID = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); numberOfEntries = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_numberOfEntries, 4, ENC_LITTLE_ENDIAN); @@ -3425,6 +3583,7 @@ handle_AuditParticipantResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) } else { ptvcursor_advance(cursor, (256 * 4)); /* guard kicked in -> skip the rest */; } + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x013d ^ conferenceID); } /* @@ -3433,9 +3592,10 @@ handle_AuditParticipantResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: dev2pbx * VarLength: no + * MsgType: request */ static void -handle_DeviceToUserDataMessageVersion1(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_DeviceToUserDataMessageVersion1(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 dataLength = 0; { @@ -3456,6 +3616,7 @@ handle_DeviceToUserDataMessageVersion1(ptvcursor_t *cursor, packet_info * pinfo dissect_skinny_xml(cursor, hf_skinny_xmldata, pinfo, dataLength, 2000); ptvcursor_pop_subtree(cursor); } + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x0041); } /* @@ -3464,9 +3625,10 @@ handle_DeviceToUserDataMessageVersion1(ptvcursor_t *cursor, packet_info * pinfo * Type: RegistrationAndManagement * Direction: dev2pbx * VarLength: no + * MsgType: response */ static void -handle_DeviceToUserDataResponseMessageVersion1(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_DeviceToUserDataResponseMessageVersion1(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 dataLength = 0; { @@ -3487,17 +3649,19 @@ handle_DeviceToUserDataResponseMessageVersion1(ptvcursor_t *cursor, packet_info dissect_skinny_xml(cursor, hf_skinny_xmldata, pinfo, dataLength, 2000); ptvcursor_pop_subtree(cursor); } + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0041); } /* - * Message: UpdateCapabilitiesV2Message + * Message: CapabilitiesV2ResMessage * Opcode: 0x0043 * Type: RegistrationAndManagement * Direction: dev2pbx * VarLength: no + * MsgType: response */ static void -handle_UpdateCapabilitiesV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_CapabilitiesV2ResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 audioCapCount = 0; guint32 videoCapCount = 0; @@ -3794,17 +3958,19 @@ handle_UpdateCapabilitiesV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_) } else { ptvcursor_advance(cursor, (dataCapCount * 16)); /* guard kicked in -> skip the rest */; } + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x009b); } /* - * Message: UpdateCapabilitiesV3Message + * Message: CapabilitiesV3ResMessage * Opcode: 0x0044 * Type: RegistrationAndManagement * Direction: dev2pbx * VarLength: yes + * MsgType: response */ static void -handle_UpdateCapabilitiesV3Message(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_CapabilitiesV3ResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 audioCapCount = 0; guint32 videoCapCount = 0; @@ -4080,6 +4246,7 @@ handle_UpdateCapabilitiesV3Message(ptvcursor_t *cursor, packet_info * pinfo _U_) } else { ptvcursor_advance(cursor, (dataCapCount * 20)); /* guard kicked in -> skip the rest */; } + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x009b); } /* @@ -4088,22 +4255,27 @@ handle_UpdateCapabilitiesV3Message(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: MediaControl * Direction: dev2pbx * VarLength: no + * MsgType: response */ static void -handle_PortResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_PortResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 hdr_version = tvb_get_letohl(ptvcursor_tvbuff(cursor), 4); + guint32 callReference = 0; ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); + callReference = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); dissect_skinny_ipv4or6(cursor, hf_skinny_ipAddr_ipv4, hf_skinny_ipAddr_ipv6); ptvcursor_add(cursor, hf_skinny_portNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_RTCPPortNumber, 4, ENC_LITTLE_ENDIAN); if (hdr_version >= V19_MSG_TYPE) { ptvcursor_add(cursor, hf_skinny_mediaType, 4, ENC_LITTLE_ENDIAN); } + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x014b ^ callReference); } /* @@ -4112,14 +4284,16 @@ handle_PortResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: event */ static void -handle_QoSResvNotifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_QoSResvNotifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); dissect_skinny_ipv4or6(cursor, hf_skinny_remoteIpAddr_ipv4, hf_skinny_remoteIpAddr_ipv6); ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_direction, 4, ENC_LITTLE_ENDIAN); @@ -4131,14 +4305,16 @@ handle_QoSResvNotifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: event */ static void -handle_QoSErrorNotifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_QoSErrorNotifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); dissect_skinny_ipv4or6(cursor, hf_skinny_remoteIpAddr_ipv4, hf_skinny_remoteIpAddr_ipv6); ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_direction, 4, ENC_LITTLE_ENDIAN); @@ -4155,14 +4331,18 @@ handle_QoSErrorNotifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: dev2pbx * VarLength: no + * MsgType: request */ static void -handle_SubscriptionStatReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_SubscriptionStatReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 transactionID = 0; + transactionID = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_transactionID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_subcriptionFeatureID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_timer, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_subscriptionID, 64, ENC_ASCII|ENC_NA); + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x0048 ^ transactionID); } /* @@ -4171,9 +4351,10 @@ handle_SubscriptionStatReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: dev2pbx * VarLength: no + * MsgType: event */ static void -handle_MediaPathEventMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_MediaPathEventMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_mediaPathID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_mediaPathEvent, 4, ENC_LITTLE_ENDIAN); @@ -4185,9 +4366,10 @@ handle_MediaPathEventMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: dev2pbx * VarLength: no + * MsgType: event */ static void -handle_MediaPathCapabilityMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_MediaPathCapabilityMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_mediaPathID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_mediaPathCapabilities, 4, ENC_LITTLE_ENDIAN); @@ -4197,11 +4379,12 @@ handle_MediaPathCapabilityMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Message: MwiNotificationMessage * Opcode: 0x004c * Type: RegistrationAndManagement - * Direction: dev2pbx + * Direction: pbx2pbx * VarLength: no + * MsgType: request */ static void -handle_MwiNotificationMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_MwiNotificationMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_mwiTargetNumber, 25, ENC_ASCII|ENC_NA); ptvcursor_add(cursor, hf_skinny_mwiControlNumber, 25, ENC_ASCII|ENC_NA); @@ -4230,6 +4413,7 @@ handle_MwiNotificationMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) ptvcursor_add(cursor, hf_skinny_numOldMsgs, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(cursor); } + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x004c); } /* @@ -4238,9 +4422,10 @@ handle_MwiNotificationMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_RegisterAckMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_RegisterAckMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_keepAliveInterval, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_dateTemplate, 6, ENC_ASCII|ENC_NA); @@ -4267,6 +4452,7 @@ handle_RegisterAckMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) ptvcursor_add_no_advance(cursor, hf_skinny_PhoneFeatures_Abbreviated_Dial, 2, ENC_LITTLE_ENDIAN); ptvcursor_advance(cursor, 2); ptvcursor_pop_subtree(cursor); /* end bitfield: PhoneFeatures */ + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0001); } /* @@ -4275,9 +4461,10 @@ handle_RegisterAckMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: MediaControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_StartToneMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_StartToneMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_tone, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_tone_output_direction, 4, ENC_LITTLE_ENDIAN); @@ -4293,9 +4480,10 @@ handle_StartToneMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: MediaControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_StopToneMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_StopToneMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 hdr_version = tvb_get_letohl(ptvcursor_tvbuff(cursor), 4); @@ -4314,9 +4502,10 @@ handle_StopToneMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_SetRingerMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_SetRingerMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_ringMode, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_ringDuration, 4, ENC_LITTLE_ENDIAN); @@ -4332,9 +4521,10 @@ handle_SetRingerMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_SetLampMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_SetLampMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_stimulus, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_stimulusInstance, 4, ENC_LITTLE_ENDIAN); @@ -4347,9 +4537,10 @@ handle_SetLampMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_SetSpeakerModeMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_SetSpeakerModeMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_speakerMode, 4, ENC_LITTLE_ENDIAN); } @@ -4360,9 +4551,10 @@ handle_SetSpeakerModeMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_SetMicroModeMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_SetMicroModeMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_micMode, 4, ENC_LITTLE_ENDIAN); } @@ -4373,17 +4565,21 @@ handle_SetMicroModeMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: MediaControl * Direction: pbx2dev * VarLength: no + * MsgType: request */ static void -handle_StartMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_StartMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 hdr_version = tvb_get_letohl(ptvcursor_tvbuff(cursor), 4); + guint32 passThruPartyId = 0; guint32 compressionType = 0; guint16 keylen = 0; guint16 saltlen = 0; ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + passThruPartyId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); dissect_skinny_ipv4or6(cursor, hf_skinny_remoteIpAddr_ipv4, hf_skinny_remoteIpAddr_ipv6); ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_millisecondPacketSize, 4, ENC_LITTLE_ENDIAN); @@ -4506,6 +4702,7 @@ handle_StartMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * pinfo _U ptvcursor_pop_subtree(cursor); } } + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x008a ^ passThruPartyId); } /* @@ -4514,12 +4711,14 @@ handle_StartMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * pinfo _U * Type: MediaControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_StopMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_StopMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_portHandlingFlag, 4, ENC_LITTLE_ENDIAN); @@ -4531,9 +4730,10 @@ handle_StopMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_ * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_CallInfoMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_CallInfoMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_callingPartyName, 40, ENC_ASCII|ENC_NA); si->callingParty = g_strdup(tvb_format_stringzpad(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor), 24)); @@ -4577,18 +4777,21 @@ handle_CallInfoMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) } /* - * Message: ForwardStatMessage + * Message: ForwardStatResMessage * Opcode: 0x0090 * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_ForwardStatMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_ForwardStatResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 lineNumber = 0; guint32 hdr_version = tvb_get_letohl(ptvcursor_tvbuff(cursor), 4); guint32 VariableDirnumSize = (hdr_version >= V18_MSG_TYPE) ? 25 : 24; ptvcursor_add(cursor, hf_skinny_activeForward, 4, ENC_LITTLE_ENDIAN); + lineNumber = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_lineNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_forwardAllActive, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_forwardAllDirnum, VariableDirnumSize, ENC_ASCII|ENC_NA); @@ -4596,49 +4799,59 @@ handle_ForwardStatMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) ptvcursor_add(cursor, hf_skinny_forwardBusyDirnum, VariableDirnumSize, ENC_ASCII|ENC_NA); ptvcursor_add(cursor, hf_skinny_forwardNoAnswerActive, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_forwardNoAnswerlDirnum, VariableDirnumSize, ENC_ASCII|ENC_NA); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0009 ^ lineNumber); } /* - * Message: SpeedDialStatMessage + * Message: SpeedDialStatResMessage * Opcode: 0x0091 * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_SpeedDialStatMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_SpeedDialStatResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 speedDialNumber = 0; + speedDialNumber = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_speedDialNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_speedDialDirNumber, 24, ENC_ASCII|ENC_NA); ptvcursor_add(cursor, hf_skinny_speedDialDisplayName, 40, ENC_ASCII|ENC_NA); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x000a ^ speedDialNumber); } /* - * Message: LineStatMessage + * Message: LineStatResMessage * Opcode: 0x0092 * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_LineStatMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_LineStatResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 lineNumber = 0; + lineNumber = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_lineNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_lineDirNumber, 24, ENC_ASCII|ENC_NA); ptvcursor_add(cursor, hf_skinny_lineFullyQualifiedDisplayName, 40, ENC_ASCII|ENC_NA); ptvcursor_add(cursor, hf_skinny_lineTextLabel, 40, ENC_ASCII|ENC_NA); ptvcursor_add(cursor, hf_skinny_lineDisplayOptions, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x000b ^ lineNumber); } /* - * Message: ConfigStatMessage + * Message: ConfigStatResMessage * Opcode: 0x0093 * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_ConfigStatMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_ConfigStatResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { { ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH, ett_skinny_tree, "sid"); @@ -4651,17 +4864,19 @@ handle_ConfigStatMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) ptvcursor_add(cursor, hf_skinny_serverName, 40, ENC_ASCII|ENC_NA); ptvcursor_add(cursor, hf_skinny_numberOfLines, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_numberOfSpeedDials, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x000c); } /* - * Message: DefineTimeDate + * Message: TimeDateResMessage * Opcode: 0x0094 * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_DefineTimeDate(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_TimeDateResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { { ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH, ett_skinny_tree, "timeDataInfo"); @@ -4676,6 +4891,7 @@ handle_DefineTimeDate(ptvcursor_t *cursor, packet_info * pinfo _U_) ptvcursor_pop_subtree(cursor); } ptvcursor_add(cursor, hf_skinny_systemTime, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x000d); } /* @@ -4684,9 +4900,10 @@ handle_DefineTimeDate(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: event */ static void -handle_StartSessionTransmissionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_StartSessionTransmissionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { dissect_skinny_ipv4or6(cursor, hf_skinny_remoteIpAddr_ipv4, hf_skinny_remoteIpAddr_ipv6); ptvcursor_add(cursor, hf_skinny_sessionType, 4, ENC_LITTLE_ENDIAN); @@ -4698,23 +4915,25 @@ handle_StartSessionTransmissionMessage(ptvcursor_t *cursor, packet_info * pinfo * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: event */ static void -handle_StopSessionTransmissionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_StopSessionTransmissionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { dissect_skinny_ipv4or6(cursor, hf_skinny_remoteIpAddr_ipv4, hf_skinny_remoteIpAddr_ipv6); ptvcursor_add(cursor, hf_skinny_sessionType, 4, ENC_LITTLE_ENDIAN); } /* - * Message: ButtonTemplateMessage + * Message: ButtonTemplateResMessage * Opcode: 0x0097 * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_ButtonTemplateMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_ButtonTemplateResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 totalButtonCount = 0; { @@ -4744,19 +4963,22 @@ handle_ButtonTemplateMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) } ptvcursor_pop_subtree(cursor); } + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x000e); } /* - * Message: VersionMessage + * Message: VersionResMessage * Opcode: 0x0098 * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_VersionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_VersionResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_version, 16, ENC_ASCII|ENC_NA); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x000f); } /* @@ -4765,9 +4987,10 @@ handle_VersionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_DisplayTextMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_DisplayTextMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_text, 32, ENC_ASCII|ENC_NA); } @@ -4778,9 +5001,10 @@ handle_DisplayTextMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_RegisterRejectMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_RegisterRejectMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_text, 32, ENC_ASCII|ENC_NA); } @@ -4791,9 +5015,10 @@ handle_RegisterRejectMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_ServerResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_ServerResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 hdr_data_length = tvb_get_letohl(ptvcursor_tvbuff(cursor), 0); @@ -4839,6 +5064,7 @@ handle_ServerResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) ptvcursor_pop_subtree(cursor); } } + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0012); } /* @@ -4847,9 +5073,10 @@ handle_ServerResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_Reset(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_Reset(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_resetType, 4, ENC_LITTLE_ENDIAN); } @@ -4860,14 +5087,18 @@ handle_Reset(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: MediaControl * Direction: pbx2dev * VarLength: no + * MsgType: request */ static void -handle_StartMulticastMediaReceptionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_StartMulticastMediaReceptionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 passThruPartyId = 0; guint32 compressionType = 0; guint32 hdr_version = tvb_get_letohl(ptvcursor_tvbuff(cursor), 4); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + passThruPartyId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); dissect_skinny_ipv4or6(cursor, hf_skinny_multicastIpAddr_ipv4, hf_skinny_multicastIpAddr_ipv6); ptvcursor_add(cursor, hf_skinny_multicastPortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_millisecondPacketSize, 4, ENC_LITTLE_ENDIAN); @@ -4901,6 +5132,7 @@ handle_StartMulticastMediaReceptionMessage(ptvcursor_t *cursor, packet_info * pi } si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x0101 ^ passThruPartyId); } /* @@ -4909,14 +5141,18 @@ handle_StartMulticastMediaReceptionMessage(ptvcursor_t *cursor, packet_info * pi * Type: MediaControl * Direction: pbx2dev * VarLength: no + * MsgType: request */ static void -handle_StartMulticastMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_StartMulticastMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 passThruPartyId = 0; guint32 compressionType = 0; guint32 hdr_version = tvb_get_letohl(ptvcursor_tvbuff(cursor), 4); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + passThruPartyId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); dissect_skinny_ipv4or6(cursor, hf_skinny_multicastIpAddr_ipv4, hf_skinny_multicastIpAddr_ipv6); ptvcursor_add(cursor, hf_skinny_multicastPortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_millisecondPacketSize, 4, ENC_LITTLE_ENDIAN); @@ -4953,6 +5189,7 @@ handle_StartMulticastMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * } si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x0102 ^ passThruPartyId); } /* @@ -4961,12 +5198,14 @@ handle_StartMulticastMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * * Type: MediaControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_StopMulticastMediaReceptionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_StopMulticastMediaReceptionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); } @@ -4977,12 +5216,14 @@ handle_StopMulticastMediaReceptionMessage(ptvcursor_t *cursor, packet_info * pin * Type: MediaControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_StopMulticastMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_StopMulticastMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); } @@ -4993,18 +5234,22 @@ handle_StopMulticastMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * * Type: MediaControl * Direction: pbx2dev * VarLength: no + * MsgType: request */ static void -handle_OpenReceiveChannelMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_OpenReceiveChannelMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 hdr_data_length = tvb_get_letohl(ptvcursor_tvbuff(cursor), 0); + guint32 passThruPartyId = 0; guint32 compressionType = 0; guint32 hdr_version = tvb_get_letohl(ptvcursor_tvbuff(cursor), 4); guint16 keylen = 0; guint16 saltlen = 0; ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + passThruPartyId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_millisecondPacketSize, 4, ENC_LITTLE_ENDIAN); compressionType = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_compressionType, 4, ENC_LITTLE_ENDIAN); @@ -5134,6 +5379,7 @@ handle_OpenReceiveChannelMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) } } } + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x0105 ^ passThruPartyId); } /* @@ -5142,12 +5388,14 @@ handle_OpenReceiveChannelMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: MediaControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_CloseReceiveChannelMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_CloseReceiveChannelMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_portHandlingFlag, 4, ENC_LITTLE_ENDIAN); @@ -5159,11 +5407,13 @@ handle_CloseReceiveChannelMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: request */ static void -handle_ConnectionStatisticsReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_ConnectionStatisticsReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 hdr_version = tvb_get_letohl(ptvcursor_tvbuff(cursor), 4); + guint32 callReference = 0; if (hdr_version <= V16_MSG_TYPE) { ptvcursor_add(cursor, hf_skinny_directoryNum, 24, ENC_ASCII|ENC_NA); @@ -5171,9 +5421,11 @@ handle_ConnectionStatisticsReqMessage(ptvcursor_t *cursor, packet_info * pinfo _ if (hdr_version >= V17_MSG_TYPE) { ptvcursor_add(cursor, hf_skinny_directoryNum, 28, ENC_ASCII|ENC_NA); } + callReference = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_statsProcessingMode, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x0107 ^ callReference); } /* @@ -5182,9 +5434,10 @@ handle_ConnectionStatisticsReqMessage(ptvcursor_t *cursor, packet_info * pinfo _ * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_SoftKeyTemplateResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_SoftKeyTemplateResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 totalSoftKeyCount = 0; { @@ -5214,6 +5467,7 @@ handle_SoftKeyTemplateResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) } ptvcursor_pop_subtree(cursor); } + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0028); } /* @@ -5222,9 +5476,10 @@ handle_SoftKeyTemplateResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_SoftKeySetResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_SoftKeySetResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 totalSoftKeySetCount = 0; { @@ -5268,6 +5523,7 @@ handle_SoftKeySetResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) } ptvcursor_pop_subtree(cursor); } + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0025); } /* @@ -5276,9 +5532,10 @@ handle_SoftKeySetResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_SelectSoftKeysMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_SelectSoftKeysMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { si->lineId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_lineInstance, 4, ENC_LITTLE_ENDIAN); @@ -5312,9 +5569,10 @@ handle_SelectSoftKeysMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_CallStateMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_CallStateMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { si->callState = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callState, 4, ENC_LITTLE_ENDIAN); @@ -5337,9 +5595,10 @@ handle_CallStateMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_DisplayPromptStatusMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_DisplayPromptStatusMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_timeOutValue, 4, ENC_LITTLE_ENDIAN); dissect_skinny_displayLabel(cursor, hf_skinny_promptStatus, 32); @@ -5355,9 +5614,10 @@ handle_DisplayPromptStatusMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_ClearPromptStatusMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_ClearPromptStatusMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { si->lineId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_lineInstance, 4, ENC_LITTLE_ENDIAN); @@ -5371,9 +5631,10 @@ handle_ClearPromptStatusMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_DisplayNotifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_DisplayNotifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_timeOutValue, 4, ENC_LITTLE_ENDIAN); dissect_skinny_displayLabel(cursor, hf_skinny_notify, 32); @@ -5385,9 +5646,10 @@ handle_DisplayNotifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_ActivateCallPlaneMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_ActivateCallPlaneMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { si->lineId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_lineInstance, 4, ENC_LITTLE_ENDIAN); @@ -5399,22 +5661,25 @@ handle_ActivateCallPlaneMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_UnregisterAckMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_UnregisterAckMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_status, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0027); } /* - * Message: BackSpaceReqMessage + * Message: BackSpaceResMessage * Opcode: 0x0119 * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_BackSpaceReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_BackSpaceResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { si->lineId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_lineInstance, 4, ENC_LITTLE_ENDIAN); @@ -5428,11 +5693,13 @@ handle_BackSpaceReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_RegisterTokenReject(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_RegisterTokenReject(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_waitTimeBeforeNextReq, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0029); } /* @@ -5441,14 +5708,16 @@ handle_RegisterTokenReject(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: MediaControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_StartMediaFailureDetectionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_StartMediaFailureDetectionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 compressionType = 0; guint32 hdr_version = tvb_get_letohl(ptvcursor_tvbuff(cursor), 4); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_millisecondPacketSize, 4, ENC_LITTLE_ENDIAN); compressionType = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_compressionType, 4, ENC_LITTLE_ENDIAN); @@ -5488,9 +5757,10 @@ handle_StartMediaFailureDetectionMessage(ptvcursor_t *cursor, packet_info * pinf * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_DialedNumberMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_DialedNumberMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 hdr_version = tvb_get_letohl(ptvcursor_tvbuff(cursor), 4); guint32 VariableDirnumSize = (hdr_version >= V18_MSG_TYPE) ? 25 : 24; @@ -5517,9 +5787,10 @@ handle_DialedNumberMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_UserToDeviceDataMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_UserToDeviceDataMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 dataLength = 0; { @@ -5538,19 +5809,23 @@ handle_UserToDeviceDataMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) } /* - * Message: FeatureStatMessage + * Message: FeatureStatResMessage * Opcode: 0x011f * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_FeatureStatMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_FeatureStatResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 featureIndex = 0; + featureIndex = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_featureIndex, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_featureID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_featureTextLabel, 40, ENC_ASCII|ENC_NA); ptvcursor_add(cursor, hf_skinny_featureStatus, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0034 ^ featureIndex); } /* @@ -5559,9 +5834,10 @@ handle_FeatureStatMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_DisplayPriNotifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_DisplayPriNotifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_timeOutValue, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_priority, 4, ENC_LITTLE_ENDIAN); @@ -5574,9 +5850,10 @@ handle_DisplayPriNotifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_ClearPriNotifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_ClearPriNotifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_priority, 4, ENC_LITTLE_ENDIAN); } @@ -5587,9 +5864,10 @@ handle_ClearPriNotifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: event */ static void -handle_StartAnnouncementMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_StartAnnouncementMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { { guint32 counter_1 = 0; @@ -5623,9 +5901,10 @@ handle_StartAnnouncementMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: event */ static void -handle_StopAnnouncementMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_StopAnnouncementMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); } @@ -5636,9 +5915,10 @@ handle_StopAnnouncementMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: event */ static void -handle_AnnouncementFinishMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_AnnouncementFinishMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_annStatus, 4, ENC_LITTLE_ENDIAN); @@ -5650,9 +5930,10 @@ handle_AnnouncementFinishMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_NotifyDtmfToneMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_NotifyDtmfToneMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_tone, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); @@ -5665,9 +5946,10 @@ handle_NotifyDtmfToneMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_SendDtmfToneMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_SendDtmfToneMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_tone, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); @@ -5680,14 +5962,16 @@ handle_SendDtmfToneMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: request */ static void -handle_SubscribeDtmfPayloadReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_SubscribeDtmfPayloadReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_payloadDtmf, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_passthruPartyID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_dtmfType, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x0129); } /* @@ -5696,13 +5980,17 @@ handle_SubscribeDtmfPayloadReqMessage(ptvcursor_t *cursor, packet_info * pinfo _ * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_SubscribeDtmfPayloadResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_SubscribeDtmfPayloadResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 passthruPartyID = 0; ptvcursor_add(cursor, hf_skinny_payloadDtmf, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); + passthruPartyID = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_passthruPartyID, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0129 ^ passthruPartyID); } /* @@ -5711,13 +5999,17 @@ handle_SubscribeDtmfPayloadResMessage(ptvcursor_t *cursor, packet_info * pinfo _ * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_SubscribeDtmfPayloadErrMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_SubscribeDtmfPayloadErrMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 passthruPartyID = 0; ptvcursor_add(cursor, hf_skinny_payloadDtmf, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); + passthruPartyID = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_passthruPartyID, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0129 ^ passthruPartyID); } /* @@ -5726,14 +6018,18 @@ handle_SubscribeDtmfPayloadErrMessage(ptvcursor_t *cursor, packet_info * pinfo _ * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: request */ static void -handle_UnSubscribeDtmfPayloadReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_UnSubscribeDtmfPayloadReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 passthruPartyID = 0; ptvcursor_add(cursor, hf_skinny_payloadDtmf, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); + passthruPartyID = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_passthruPartyID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_dtmfType, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x012c ^ passthruPartyID); } /* @@ -5742,13 +6038,17 @@ handle_UnSubscribeDtmfPayloadReqMessage(ptvcursor_t *cursor, packet_info * pinfo * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_UnSubscribeDtmfPayloadResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_UnSubscribeDtmfPayloadResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 passthruPartyID = 0; ptvcursor_add(cursor, hf_skinny_payloadDtmf, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); + passthruPartyID = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_passthruPartyID, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x012d ^ passthruPartyID); } /* @@ -5757,39 +6057,48 @@ handle_UnSubscribeDtmfPayloadResMessage(ptvcursor_t *cursor, packet_info * pinfo * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_UnSubscribeDtmfPayloadErrMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_UnSubscribeDtmfPayloadErrMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 passthruPartyID = 0; ptvcursor_add(cursor, hf_skinny_payloadDtmf, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); + passthruPartyID = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_passthruPartyID, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x012d ^ passthruPartyID); } /* - * Message: ServiceURLStatMessage + * Message: ServiceURLStatResMessage * Opcode: 0x012f * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_ServiceURLStatMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_ServiceURLStatResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 serviceURLIndex = 0; + serviceURLIndex = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_serviceURLIndex, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_serviceURL, 256, ENC_ASCII|ENC_NA); ptvcursor_add(cursor, hf_skinny_serviceURLDisplayName, 40, ENC_ASCII|ENC_NA); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0033 ^ serviceURLIndex); } /* - * Message: CallSelectStatMessage + * Message: CallSelectStatResMessage * Opcode: 0x0130 * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_CallSelectStatMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_CallSelectStatResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_callSelectStat, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); @@ -5804,11 +6113,13 @@ handle_CallSelectStatMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: MediaControl * Direction: pbx2dev * VarLength: no + * MsgType: request */ static void -handle_OpenMultiMediaReceiveChannelMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_OpenMultiMediaReceiveChannelMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 hdr_version = tvb_get_letohl(ptvcursor_tvbuff(cursor), 4); + guint32 passThruPartyId = 0; guint32 compressionType = 0; guint32 payloadType = 0; guint32 pictureFormatCount = 0; @@ -5816,7 +6127,9 @@ handle_OpenMultiMediaReceiveChannelMessage(ptvcursor_t *cursor, packet_info * pi guint16 saltlen = 0; ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + passThruPartyId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); compressionType = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_compressionType, 4, ENC_LITTLE_ENDIAN); si->lineId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); @@ -6033,6 +6346,7 @@ handle_OpenMultiMediaReceiveChannelMessage(ptvcursor_t *cursor, packet_info * pi if (hdr_version >= V16_MSG_TYPE) { ptvcursor_add(cursor, hf_skinny_requestedIpAddrType, 4, ENC_LITTLE_ENDIAN); } + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x0131 ^ passThruPartyId); } /* @@ -6041,10 +6355,12 @@ handle_OpenMultiMediaReceiveChannelMessage(ptvcursor_t *cursor, packet_info * pi * Type: MediaControl * Direction: pbx2dev * VarLength: no + * MsgType: request */ static void -handle_StartMultiMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_StartMultiMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 passthruPartyID = 0; guint32 compressionType = 0; guint32 payloadType = 0; guint32 hdr_version = tvb_get_letohl(ptvcursor_tvbuff(cursor), 4); @@ -6052,6 +6368,7 @@ handle_StartMultiMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * pin guint16 keylen = 0; guint16 saltlen = 0; ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); + passthruPartyID = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_passthruPartyID, 4, ENC_LITTLE_ENDIAN); compressionType = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_compressionType, 4, ENC_LITTLE_ENDIAN); @@ -6262,6 +6579,7 @@ handle_StartMultiMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * pin } ptvcursor_add(cursor, hf_skinny_streamPassThroughID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_associatedStreamID, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x0132 ^ passthruPartyID); } /* @@ -6270,12 +6588,14 @@ handle_StartMultiMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * pin * Type: MediaControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_StopMultiMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_StopMultiMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_portHandlingFlag, 4, ENC_LITTLE_ENDIAN); @@ -6287,9 +6607,10 @@ handle_StopMultiMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * pinf * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_MiscellaneousCommandMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_MiscellaneousCommandMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 command = 0; guint32 recoveryReferencePictureCount = 0; @@ -6403,9 +6724,10 @@ handle_MiscellaneousCommandMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_FlowControlCommandMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_FlowControlCommandMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_passthruPartyID, 4, ENC_LITTLE_ENDIAN); @@ -6420,12 +6742,14 @@ handle_FlowControlCommandMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: MediaControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_CloseMultiMediaReceiveChannelMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_CloseMultiMediaReceiveChannelMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_portHandlingFlag, 4, ENC_LITTLE_ENDIAN); @@ -6437,11 +6761,14 @@ handle_CloseMultiMediaReceiveChannelMessage(ptvcursor_t *cursor, packet_info * p * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: request */ static void -handle_CreateConferenceReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_CreateConferenceReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 conferenceID = 0; guint32 dataLength = 0; + conferenceID = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_numberOfReservedParticipants, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_resourceType, 4, ENC_LITTLE_ENDIAN); @@ -6451,6 +6778,7 @@ handle_CreateConferenceReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) dataLength = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_dataLength, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_passThruData, dataLength, ENC_ASCII|ENC_NA); + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x0137 ^ conferenceID); } /* @@ -6459,11 +6787,15 @@ handle_CreateConferenceReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: request */ static void -handle_DeleteConferenceReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_DeleteConferenceReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 conferenceID = 0; + conferenceID = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x0138 ^ conferenceID); } /* @@ -6472,11 +6804,14 @@ handle_DeleteConferenceReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: request */ static void -handle_ModifyConferenceReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_ModifyConferenceReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 conferenceID = 0; guint32 dataLength = 0; + conferenceID = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_numberOfReservedParticipants, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_appID, 4, ENC_LITTLE_ENDIAN); @@ -6485,6 +6820,7 @@ handle_ModifyConferenceReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) dataLength = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_dataLength, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_passThruData, dataLength, ENC_ASCII|ENC_NA); + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x0139 ^ conferenceID); } /* @@ -6493,10 +6829,13 @@ handle_ModifyConferenceReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: request */ static void -handle_AddParticipantReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_AddParticipantReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 conferenceID = 0; + conferenceID = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); @@ -6519,6 +6858,7 @@ handle_AddParticipantReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) ptvcursor_add(cursor, hf_skinny_participantName, 40, ENC_ASCII|ENC_NA); ptvcursor_add(cursor, hf_skinny_participantNumber, 24, ENC_ASCII|ENC_NA); ptvcursor_add(cursor, hf_skinny_conferenceName, 32, ENC_ASCII|ENC_NA); + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x013a ^ conferenceID); } /* @@ -6527,13 +6867,17 @@ handle_AddParticipantReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: request */ static void -handle_DropParticipantReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_DropParticipantReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 conferenceID = 0; + conferenceID = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x013b ^ conferenceID); } /* @@ -6542,11 +6886,15 @@ handle_DropParticipantReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: request */ static void -handle_AuditParticipantReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_AuditParticipantReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 conferenceID = 0; + conferenceID = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x013d ^ conferenceID); } /* @@ -6555,10 +6903,13 @@ handle_AuditParticipantReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: request */ static void -handle_ChangeParticipantReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_ChangeParticipantReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 conferenceID = 0; + conferenceID = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); @@ -6581,6 +6932,7 @@ handle_ChangeParticipantReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) ptvcursor_add(cursor, hf_skinny_participantName, 40, ENC_ASCII|ENC_NA); ptvcursor_add(cursor, hf_skinny_participantNumber, 24, ENC_ASCII|ENC_NA); ptvcursor_add(cursor, hf_skinny_conferenceName, 32, ENC_ASCII|ENC_NA); + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x013e ^ conferenceID); } /* @@ -6589,9 +6941,10 @@ handle_ChangeParticipantReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_UserToDeviceDataMessageVersion1(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_UserToDeviceDataMessageVersion1(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 dataLength = 0; { @@ -6620,9 +6973,10 @@ handle_UserToDeviceDataMessageVersion1(ptvcursor_t *cursor, packet_info * pinfo * Type: MediaControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_VideoDisplayCommandMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_VideoDisplayCommandMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); @@ -6636,9 +6990,10 @@ handle_VideoDisplayCommandMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_FlowControlNotifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_FlowControlNotifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_passthruPartyID, 4, ENC_LITTLE_ENDIAN); @@ -6648,14 +7003,15 @@ handle_FlowControlNotifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) } /* - * Message: ConfigStatV2Message + * Message: ConfigStatV2ResMessage * Opcode: 0x0142 * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: yes + * MsgType: response */ static void -handle_ConfigStatV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_ConfigStatV2ResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 DeviceName_len = 0; guint32 userName_len = 0; @@ -6686,6 +7042,7 @@ handle_ConfigStatV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_) } else { ptvcursor_advance(cursor, 1); } + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x000c); } /* @@ -6694,9 +7051,10 @@ handle_ConfigStatV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: yes + * MsgType: event */ static void -handle_DisplayNotifyV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_DisplayNotifyV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_timeOutValue, 4, ENC_LITTLE_ENDIAN); dissect_skinny_displayLabel(cursor, hf_skinny_notify, 0); @@ -6708,9 +7066,10 @@ handle_DisplayNotifyV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: yes + * MsgType: event */ static void -handle_DisplayPriNotifyV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_DisplayPriNotifyV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_timeOutValue, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_priority, 4, ENC_LITTLE_ENDIAN); @@ -6723,9 +7082,10 @@ handle_DisplayPriNotifyV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: pbx2dev * VarLength: yes + * MsgType: event */ static void -handle_DisplayPromptStatusV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_DisplayPromptStatusV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_timeOutValue, 4, ENC_LITTLE_ENDIAN); si->lineId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); @@ -6736,14 +7096,15 @@ handle_DisplayPromptStatusV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_ } /* - * Message: FeatureStatV2Message + * Message: FeatureStatV2ResMessage * Opcode: 0x0146 * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: yes + * MsgType: response */ static void -handle_FeatureStatV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_FeatureStatV2ResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 featureTextLabel_len = 0; ptvcursor_add(cursor, hf_skinny_featureIndex, 4, ENC_LITTLE_ENDIAN); @@ -6755,21 +7116,25 @@ handle_FeatureStatV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_) } else { ptvcursor_advance(cursor, 1); } + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0034); } /* - * Message: LineStatV2Message + * Message: LineStatV2ResMessage * Opcode: 0x0147 * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: yes + * MsgType: response */ static void -handle_LineStatV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_LineStatV2ResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 lineNumber = 0; guint32 lineDirNumber_len = 0; guint32 lineFullyQualifiedDisplayName_len = 0; guint32 lineTextLabel_len = 0; + lineNumber = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_lineNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH, ett_skinny_tree, "lineType"); ptvcursor_add_no_advance(cursor, hf_skinny_OrigDialed, 4, ENC_LITTLE_ENDIAN); @@ -6796,33 +7161,41 @@ handle_LineStatV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_) } else { ptvcursor_advance(cursor, 1); } + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x000b ^ lineNumber); } /* - * Message: ServiceURLStatV2Message + * Message: ServiceURLStatV2ResMessage * Opcode: 0x0148 * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: yes + * MsgType: response */ static void -handle_ServiceURLStatV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_ServiceURLStatV2ResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 serviceURLIndex = 0; + serviceURLIndex = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_serviceURLIndex, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0033 ^ serviceURLIndex); } /* - * Message: SpeedDialStatV2Message + * Message: SpeedDialStatV2ResMessage * Opcode: 0x0149 * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: yes + * MsgType: response */ static void -handle_SpeedDialStatV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_SpeedDialStatV2ResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 speedDialNumber = 0; guint32 speedDialDirNumber_len = 0; guint32 speedDialDisplayName_len = 0; + speedDialNumber = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_speedDialNumber, 4, ENC_LITTLE_ENDIAN); speedDialDirNumber_len = tvb_strnlen(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor), -1)+1; if (speedDialDirNumber_len > 1) { @@ -6836,6 +7209,7 @@ handle_SpeedDialStatV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_) } else { ptvcursor_advance(cursor, 1); } + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x000a ^ speedDialNumber); } /* @@ -6844,9 +7218,10 @@ handle_SpeedDialStatV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: pbx2dev * VarLength: yes + * MsgType: event */ static void -handle_CallInfoV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_CallInfoV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 hdr_version = tvb_get_letohl(ptvcursor_tvbuff(cursor), 4); guint32 callingParty_len = 0; @@ -6992,17 +7367,20 @@ handle_CallInfoV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: MediaControl * Direction: pbx2dev * VarLength: no + * MsgType: request */ static void -handle_PortReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_PortReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_mediaTransportType, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_ipAddressType, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_mediaType, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x014b); } /* @@ -7011,14 +7389,16 @@ handle_PortReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: MediaControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_PortCloseMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_PortCloseMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_mediaType, 4, ENC_LITTLE_ENDIAN); } @@ -7028,14 +7408,16 @@ handle_PortCloseMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: event */ static void -handle_QoSListenMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_QoSListenMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); dissect_skinny_ipv4or6(cursor, hf_skinny_remoteIpAddr_ipv4, hf_skinny_remoteIpAddr_ipv6); ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_resvStyle, 4, ENC_LITTLE_ENDIAN); @@ -7064,14 +7446,16 @@ handle_QoSListenMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: event */ static void -handle_QoSPathMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_QoSPathMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); dissect_skinny_ipv4or6(cursor, hf_skinny_remoteIpAddr_ipv4, hf_skinny_remoteIpAddr_ipv6); ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_resvStyle, 4, ENC_LITTLE_ENDIAN); @@ -7099,14 +7483,16 @@ handle_QoSPathMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: event */ static void -handle_QoSTeardownMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_QoSTeardownMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); dissect_skinny_ipv4or6(cursor, hf_skinny_remoteIpAddr_ipv4, hf_skinny_remoteIpAddr_ipv6); ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_direction, 4, ENC_LITTLE_ENDIAN); @@ -7118,14 +7504,16 @@ handle_QoSTeardownMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: event */ static void -handle_UpdateDSCPMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_UpdateDSCPMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); dissect_skinny_ipv4or6(cursor, hf_skinny_remoteIpAddr_ipv4, hf_skinny_remoteIpAddr_ipv6); ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_DSCPValue, 4, ENC_LITTLE_ENDIAN); @@ -7137,14 +7525,16 @@ handle_UpdateDSCPMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: IntraCCM * Direction: pbx2pbx * VarLength: no + * MsgType: event */ static void -handle_QoSModifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_QoSModifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); dissect_skinny_ipv4or6(cursor, hf_skinny_remoteIpAddr_ipv4, hf_skinny_remoteIpAddr_ipv6); ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_direction, 4, ENC_LITTLE_ENDIAN); @@ -7163,19 +7553,23 @@ handle_QoSModifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) } /* - * Message: SubscriptionStatMessage + * Message: SubscriptionStatResMessage * Opcode: 0x0152 * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_SubscriptionStatMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_SubscriptionStatResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 transactionID = 0; + transactionID = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_transactionID, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_subscriptionoFeatureID, 4, ENC_LITTLE_ENDIAN); + ptvcursor_add(cursor, hf_skinny_subscriptionFeatureID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_timer, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_cause, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0048 ^ transactionID); } /* @@ -7184,13 +7578,14 @@ handle_SubscriptionStatMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_NotificationMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_NotificationMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_transactionID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_subscriptionFeatureID, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_status, 4, ENC_LITTLE_ENDIAN); + ptvcursor_add(cursor, hf_skinny_notificationStatus, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_text, 97, ENC_ASCII|ENC_NA); } @@ -7200,18 +7595,23 @@ handle_NotificationMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: MediaControl * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_StartMediaTransmissionAckMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_StartMediaTransmissionAckMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 passThruPartyId = 0; ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + passThruPartyId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); dissect_skinny_ipv4or6(cursor, hf_skinny_transmitIpAddr_ipv4, hf_skinny_transmitIpAddr_ipv6); ptvcursor_add(cursor, hf_skinny_portNumber, 4, ENC_LITTLE_ENDIAN); si->mediaTransmissionStatus = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_mediaTransmissionStatus, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x008a ^ passThruPartyId); } /* @@ -7220,18 +7620,23 @@ handle_StartMediaTransmissionAckMessage(ptvcursor_t *cursor, packet_info * pinfo * Type: MediaControl * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_StartMultiMediaTransmissionAckMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_StartMultiMediaTransmissionAckMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { + guint32 passThruPartyId = 0; ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); - ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); + passThruPartyId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + si->passThruId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + ptvcursor_add(cursor, hf_skinny_passThruPartyId, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); dissect_skinny_ipv4or6(cursor, hf_skinny_transmitIpAddr_ipv4, hf_skinny_transmitIpAddr_ipv6); ptvcursor_add(cursor, hf_skinny_portNumber, 4, ENC_LITTLE_ENDIAN); si->multimediaTransmissionStatus = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_multimediaTransmissionStatus, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x0132 ^ passThruPartyId); } /* @@ -7240,9 +7645,10 @@ handle_StartMultiMediaTransmissionAckMessage(ptvcursor_t *cursor, packet_info * * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_CallHistoryInfoMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_CallHistoryInfoMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_callHistoryDisposition, 4, ENC_LITTLE_ENDIAN); si->lineId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); @@ -7253,30 +7659,33 @@ handle_CallHistoryInfoMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) /* * Message: LocationInfoMessage - * Opcode: 0x0156 + * Opcode: 0x0157 * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: event * Comment: Sent by wifi devices, contains xml information about connected SSID */ static void -handle_LocationInfoMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_LocationInfoMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_locationInfo, 2401, ENC_ASCII|ENC_NA); } /* - * Message: MwiResponseMessage + * Message: MwiResMessage * Opcode: 0x0158 * Type: RegistrationAndManagement - * Direction: pbx2dev + * Direction: pbx2pbx * VarLength: no + * MsgType: response */ static void -handle_MwiResponseMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_MwiResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_mwiTargetNumber, 25, ENC_ASCII|ENC_NA); ptvcursor_add(cursor, hf_skinny_mwi_notification_result, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x004c); } /* @@ -7285,9 +7694,10 @@ handle_MwiResponseMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: dev2pbx * VarLength: no + * MsgType: event */ static void -handle_AddOnDeviceCapabilitiesMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_AddOnDeviceCapabilitiesMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_unknown1_0159, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_unknown2_0159, 4, ENC_LITTLE_ENDIAN); @@ -7301,9 +7711,10 @@ handle_AddOnDeviceCapabilitiesMessage(ptvcursor_t *cursor, packet_info * pinfo _ * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_EnhancedAlarmMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_EnhancedAlarmMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { dissect_skinny_xml(cursor, hf_skinny_alarmInfo, pinfo, 0, 2048); } @@ -7312,11 +7723,12 @@ handle_EnhancedAlarmMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Message: CallCountRespMessage * Opcode: 0x015f * Type: CallControl - * Direction: pbx2dev + * Direction: pbx2pbx * VarLength: no + * MsgType: response */ static void -handle_CallCountRespMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_CallCountRespMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { guint32 lineDataEntries = 0; ptvcursor_add(cursor, hf_skinny_totalNumOfConfiguredLines, 4, ENC_LITTLE_ENDIAN); @@ -7342,6 +7754,7 @@ handle_CallCountRespMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) } else { ptvcursor_advance(cursor, (lineDataEntries * 4)); /* guard kicked in -> skip the rest */; } + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x015e); } /* @@ -7350,9 +7763,10 @@ handle_CallCountRespMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: CallControl * Direction: pbx2dev * VarLength: no + * MsgType: event */ static void -handle_RecordingStatusMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_RecordingStatusMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); @@ -7365,9 +7779,10 @@ handle_RecordingStatusMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: dev2pbx * VarLength: no + * MsgType: request */ static void -handle_SPCPRegisterTokenReq(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_SPCPRegisterTokenReq(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { { ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH, ett_skinny_tree, "sid"); @@ -7379,6 +7794,7 @@ handle_SPCPRegisterTokenReq(ptvcursor_t *cursor, packet_info * pinfo _U_) ptvcursor_add(cursor, hf_skinny_stationIpAddr, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_deviceType, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_maxStreams, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_request(cursor, pinfo, skinny_conv, 0x8000); } /* @@ -7387,11 +7803,13 @@ handle_SPCPRegisterTokenReq(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_SPCPRegisterTokenAck(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_SPCPRegisterTokenAck(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_features, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x8000); } /* @@ -7400,191 +7818,197 @@ handle_SPCPRegisterTokenAck(ptvcursor_t *cursor, packet_info * pinfo _U_) * Type: RegistrationAndManagement * Direction: pbx2dev * VarLength: no + * MsgType: response */ static void -handle_SPCPRegisterTokenReject(ptvcursor_t *cursor, packet_info * pinfo _U_) +handle_SPCPRegisterTokenReject(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) { ptvcursor_add(cursor, hf_skinny_waitTimeBeforeNextReq, 4, ENC_LITTLE_ENDIAN); + skinny_reqrep_add_response(cursor, pinfo, skinny_conv, 0x8000); } -/* Messages Handler Array */ -typedef void (*message_handler) (ptvcursor_t * cursor, packet_info *pinfo); -static const struct opcode2handler { - guint16 opcode; +typedef void (*message_handler) (ptvcursor_t * cursor, packet_info *pinfo, skinny_conv_info_t * skinny_conv); + +typedef struct _skinny_opcode_map_t { + guint32 opcode; message_handler handler; + skinny_message_type_t type; const char *name; -} skinny_opcode2handler[] = { - {0x0000, NULL , "KeepAliveMessage"}, - {0x0001, handle_RegisterMessage , "RegisterMessage"}, - {0x0002, handle_IpPortMessage , "IpPortMessage"}, - {0x0003, handle_KeypadButtonMessage , "KeypadButtonMessage"}, - {0x0004, handle_EnblocCallMessage , "EnblocCallMessage"}, - {0x0005, handle_StimulusMessage , "StimulusMessage"}, - {0x0006, handle_OffHookMessage , "OffHookMessage"}, - {0x0007, handle_OnHookMessage , "OnHookMessage"}, - {0x0008, handle_HookFlashMessage , "HookFlashMessage"}, - {0x0009, handle_ForwardStatReqMessage , "ForwardStatReqMessage"}, - {0x000a, handle_SpeedDialStatReqMessage , "SpeedDialStatReqMessage"}, - {0x000b, handle_LineStatReqMessage , "LineStatReqMessage"}, - {0x000c, NULL , "ConfigStatReqMessage"}, - {0x000d, NULL , "TimeDateReqMessage"}, - {0x000e, NULL , "ButtonTemplateReqMessage"}, - {0x000f, NULL , "VersionReqMessage"}, - {0x0010, handle_CapabilitiesRes , "CapabilitiesRes"}, - {0x0012, NULL , "ServerReqMessage"}, - {0x0020, handle_AlarmMessage , "AlarmMessage"}, - {0x0021, handle_MulticastMediaReceptionAckMessage , "MulticastMediaReceptionAckMessage"}, - {0x0022, handle_OpenReceiveChannelAckMessage , "OpenReceiveChannelAckMessage"}, - {0x0023, handle_ConnectionStatisticsResMessage , "ConnectionStatisticsResMessage"}, - {0x0024, handle_OffHookWithCgpnMessage , "OffHookWithCgpnMessage"}, - {0x0025, NULL , "SoftKeySetReqMessage"}, - {0x0026, handle_SoftKeyEventMessage , "SoftKeyEventMessage"}, - {0x0027, handle_UnregisterMessage , "UnregisterMessage"}, - {0x0028, NULL , "SoftKeyTemplateReqMessage"}, - {0x0029, handle_RegisterTokenReq , "RegisterTokenReq"}, - {0x002a, handle_MediaTransmissionFailureMessage , "MediaTransmissionFailureMessage"}, - {0x002b, handle_HeadsetStatusMessage , "HeadsetStatusMessage"}, - {0x002c, handle_MediaResourceNotificationMessage , "MediaResourceNotificationMessage"}, - {0x002d, handle_RegisterAvailableLinesMessage , "RegisterAvailableLinesMessage"}, - {0x002e, handle_DeviceToUserDataMessage , "DeviceToUserDataMessage"}, - {0x002f, handle_DeviceToUserDataResponseMessage , "DeviceToUserDataResponseMessage"}, - {0x0030, handle_UpdateCapabilitiesMessage , "UpdateCapabilitiesMessage"}, - {0x0031, handle_OpenMultiMediaReceiveChannelAckMessage , "OpenMultiMediaReceiveChannelAckMessage"}, - {0x0032, handle_ClearConferenceMessage , "ClearConferenceMessage"}, - {0x0033, handle_ServiceURLStatReqMessage , "ServiceURLStatReqMessage"}, - {0x0034, handle_FeatureStatReqMessage , "FeatureStatReqMessage"}, - {0x0035, handle_CreateConferenceResMessage , "CreateConferenceResMessage"}, - {0x0036, handle_DeleteConferenceResMessage , "DeleteConferenceResMessage"}, - {0x0037, handle_ModifyConferenceResMessage , "ModifyConferenceResMessage"}, - {0x0038, handle_AddParticipantResMessage , "AddParticipantResMessage"}, - {0x0039, handle_AuditConferenceResMessage , "AuditConferenceResMessage"}, - {0x0040, handle_AuditParticipantResMessage , "AuditParticipantResMessage"}, - {0x0041, handle_DeviceToUserDataMessageVersion1 , "DeviceToUserDataMessageVersion1"}, - {0x0042, handle_DeviceToUserDataResponseMessageVersion1 , "DeviceToUserDataResponseMessageVersion1"}, - {0x0043, handle_UpdateCapabilitiesV2Message , "UpdateCapabilitiesV2Message"}, - {0x0044, handle_UpdateCapabilitiesV3Message , "UpdateCapabilitiesV3Message"}, - {0x0045, handle_PortResMessage , "PortResMessage"}, - {0x0046, handle_QoSResvNotifyMessage , "QoSResvNotifyMessage"}, - {0x0047, handle_QoSErrorNotifyMessage , "QoSErrorNotifyMessage"}, - {0x0048, handle_SubscriptionStatReqMessage , "SubscriptionStatReqMessage"}, - {0x0049, handle_MediaPathEventMessage , "MediaPathEventMessage"}, - {0x004a, handle_MediaPathCapabilityMessage , "MediaPathCapabilityMessage"}, - {0x004c, handle_MwiNotificationMessage , "MwiNotificationMessage"}, - {0x0081, handle_RegisterAckMessage , "RegisterAckMessage"}, - {0x0082, handle_StartToneMessage , "StartToneMessage"}, - {0x0083, handle_StopToneMessage , "StopToneMessage"}, - {0x0085, handle_SetRingerMessage , "SetRingerMessage"}, - {0x0086, handle_SetLampMessage , "SetLampMessage"}, - {0x0088, handle_SetSpeakerModeMessage , "SetSpeakerModeMessage"}, - {0x0089, handle_SetMicroModeMessage , "SetMicroModeMessage"}, - {0x008a, handle_StartMediaTransmissionMessage , "StartMediaTransmissionMessage"}, - {0x008b, handle_StopMediaTransmissionMessage , "StopMediaTransmissionMessage"}, - {0x008f, handle_CallInfoMessage , "CallInfoMessage"}, - {0x0090, handle_ForwardStatMessage , "ForwardStatMessage"}, - {0x0091, handle_SpeedDialStatMessage , "SpeedDialStatMessage"}, - {0x0092, handle_LineStatMessage , "LineStatMessage"}, - {0x0093, handle_ConfigStatMessage , "ConfigStatMessage"}, - {0x0094, handle_DefineTimeDate , "DefineTimeDate"}, - {0x0095, handle_StartSessionTransmissionMessage , "StartSessionTransmissionMessage"}, - {0x0096, handle_StopSessionTransmissionMessage , "StopSessionTransmissionMessage"}, - {0x0097, handle_ButtonTemplateMessage , "ButtonTemplateMessage"}, - {0x0098, handle_VersionMessage , "VersionMessage"}, - {0x0099, handle_DisplayTextMessage , "DisplayTextMessage"}, - {0x009a, NULL , "ClearDisplay"}, - {0x009b, NULL , "CapabilitiesReq"}, - {0x009d, handle_RegisterRejectMessage , "RegisterRejectMessage"}, - {0x009e, handle_ServerResMessage , "ServerResMessage"}, - {0x009f, handle_Reset , "Reset"}, - {0x0100, NULL , "KeepAliveAckMessage"}, - {0x0101, handle_StartMulticastMediaReceptionMessage , "StartMulticastMediaReceptionMessage"}, - {0x0102, handle_StartMulticastMediaTransmissionMessage , "StartMulticastMediaTransmissionMessage"}, - {0x0103, handle_StopMulticastMediaReceptionMessage , "StopMulticastMediaReceptionMessage"}, - {0x0104, handle_StopMulticastMediaTransmissionMessage , "StopMulticastMediaTransmissionMessage"}, - {0x0105, handle_OpenReceiveChannelMessage , "OpenReceiveChannelMessage"}, - {0x0106, handle_CloseReceiveChannelMessage , "CloseReceiveChannelMessage"}, - {0x0107, handle_ConnectionStatisticsReqMessage , "ConnectionStatisticsReqMessage"}, - {0x0108, handle_SoftKeyTemplateResMessage , "SoftKeyTemplateResMessage"}, - {0x0109, handle_SoftKeySetResMessage , "SoftKeySetResMessage"}, - {0x0110, handle_SelectSoftKeysMessage , "SelectSoftKeysMessage"}, - {0x0111, handle_CallStateMessage , "CallStateMessage"}, - {0x0112, handle_DisplayPromptStatusMessage , "DisplayPromptStatusMessage"}, - {0x0113, handle_ClearPromptStatusMessage , "ClearPromptStatusMessage"}, - {0x0114, handle_DisplayNotifyMessage , "DisplayNotifyMessage"}, - {0x0115, NULL , "ClearNotifyMessage"}, - {0x0116, handle_ActivateCallPlaneMessage , "ActivateCallPlaneMessage"}, - {0x0117, NULL , "DeactivateCallPlaneMessage"}, - {0x0118, handle_UnregisterAckMessage , "UnregisterAckMessage"}, - {0x0119, handle_BackSpaceReqMessage , "BackSpaceReqMessage"}, - {0x011a, NULL , "RegisterTokenAck"}, - {0x011b, handle_RegisterTokenReject , "RegisterTokenReject"}, - {0x011c, handle_StartMediaFailureDetectionMessage , "StartMediaFailureDetectionMessage"}, - {0x011d, handle_DialedNumberMessage , "DialedNumberMessage"}, - {0x011e, handle_UserToDeviceDataMessage , "UserToDeviceDataMessage"}, - {0x011f, handle_FeatureStatMessage , "FeatureStatMessage"}, - {0x0120, handle_DisplayPriNotifyMessage , "DisplayPriNotifyMessage"}, - {0x0121, handle_ClearPriNotifyMessage , "ClearPriNotifyMessage"}, - {0x0122, handle_StartAnnouncementMessage , "StartAnnouncementMessage"}, - {0x0123, handle_StopAnnouncementMessage , "StopAnnouncementMessage"}, - {0x0124, handle_AnnouncementFinishMessage , "AnnouncementFinishMessage"}, - {0x0127, handle_NotifyDtmfToneMessage , "NotifyDtmfToneMessage"}, - {0x0128, handle_SendDtmfToneMessage , "SendDtmfToneMessage"}, - {0x0129, handle_SubscribeDtmfPayloadReqMessage , "SubscribeDtmfPayloadReqMessage"}, - {0x012a, handle_SubscribeDtmfPayloadResMessage , "SubscribeDtmfPayloadResMessage"}, - {0x012b, handle_SubscribeDtmfPayloadErrMessage , "SubscribeDtmfPayloadErrMessage"}, - {0x012c, handle_UnSubscribeDtmfPayloadReqMessage , "UnSubscribeDtmfPayloadReqMessage"}, - {0x012d, handle_UnSubscribeDtmfPayloadResMessage , "UnSubscribeDtmfPayloadResMessage"}, - {0x012e, handle_UnSubscribeDtmfPayloadErrMessage , "UnSubscribeDtmfPayloadErrMessage"}, - {0x012f, handle_ServiceURLStatMessage , "ServiceURLStatMessage"}, - {0x0130, handle_CallSelectStatMessage , "CallSelectStatMessage"}, - {0x0131, handle_OpenMultiMediaReceiveChannelMessage , "OpenMultiMediaReceiveChannelMessage"}, - {0x0132, handle_StartMultiMediaTransmissionMessage , "StartMultiMediaTransmissionMessage"}, - {0x0133, handle_StopMultiMediaTransmissionMessage , "StopMultiMediaTransmissionMessage"}, - {0x0134, handle_MiscellaneousCommandMessage , "MiscellaneousCommandMessage"}, - {0x0135, handle_FlowControlCommandMessage , "FlowControlCommandMessage"}, - {0x0136, handle_CloseMultiMediaReceiveChannelMessage , "CloseMultiMediaReceiveChannelMessage"}, - {0x0137, handle_CreateConferenceReqMessage , "CreateConferenceReqMessage"}, - {0x0138, handle_DeleteConferenceReqMessage , "DeleteConferenceReqMessage"}, - {0x0139, handle_ModifyConferenceReqMessage , "ModifyConferenceReqMessage"}, - {0x013a, handle_AddParticipantReqMessage , "AddParticipantReqMessage"}, - {0x013b, handle_DropParticipantReqMessage , "DropParticipantReqMessage"}, - {0x013c, NULL , "AuditConferenceReqMessage"}, - {0x013d, handle_AuditParticipantReqMessage , "AuditParticipantReqMessage"}, - {0x013e, handle_ChangeParticipantReqMessage , "ChangeParticipantReqMessage"}, - {0x013f, handle_UserToDeviceDataMessageVersion1 , "UserToDeviceDataMessageVersion1"}, - {0x0140, handle_VideoDisplayCommandMessage , "VideoDisplayCommandMessage"}, - {0x0141, handle_FlowControlNotifyMessage , "FlowControlNotifyMessage"}, - {0x0142, handle_ConfigStatV2Message , "ConfigStatV2Message"}, - {0x0143, handle_DisplayNotifyV2Message , "DisplayNotifyV2Message"}, - {0x0144, handle_DisplayPriNotifyV2Message , "DisplayPriNotifyV2Message"}, - {0x0145, handle_DisplayPromptStatusV2Message , "DisplayPromptStatusV2Message"}, - {0x0146, handle_FeatureStatV2Message , "FeatureStatV2Message"}, - {0x0147, handle_LineStatV2Message , "LineStatV2Message"}, - {0x0148, handle_ServiceURLStatV2Message , "ServiceURLStatV2Message"}, - {0x0149, handle_SpeedDialStatV2Message , "SpeedDialStatV2Message"}, - {0x014a, handle_CallInfoV2Message , "CallInfoV2Message"}, - {0x014b, handle_PortReqMessage , "PortReqMessage"}, - {0x014c, handle_PortCloseMessage , "PortCloseMessage"}, - {0x014d, handle_QoSListenMessage , "QoSListenMessage"}, - {0x014e, handle_QoSPathMessage , "QoSPathMessage"}, - {0x014f, handle_QoSTeardownMessage , "QoSTeardownMessage"}, - {0x0150, handle_UpdateDSCPMessage , "UpdateDSCPMessage"}, - {0x0151, handle_QoSModifyMessage , "QoSModifyMessage"}, - {0x0152, handle_SubscriptionStatMessage , "SubscriptionStatMessage"}, - {0x0153, handle_NotificationMessage , "NotificationMessage"}, - {0x0154, handle_StartMediaTransmissionAckMessage , "StartMediaTransmissionAckMessage"}, - {0x0155, handle_StartMultiMediaTransmissionAckMessage , "StartMultiMediaTransmissionAckMessage"}, - {0x0156, handle_CallHistoryInfoMessage , "CallHistoryInfoMessage"}, - {0x0156, handle_LocationInfoMessage , "LocationInfoMessage"}, - {0x0158, handle_MwiResponseMessage , "MwiResponseMessage"}, - {0x0159, handle_AddOnDeviceCapabilitiesMessage , "AddOnDeviceCapabilitiesMessage"}, - {0x015a, handle_EnhancedAlarmMessage , "EnhancedAlarmMessage"}, - {0x015e, NULL , "CallCountReqMessage"}, - {0x015f, handle_CallCountRespMessage , "CallCountRespMessage"}, - {0x0160, handle_RecordingStatusMessage , "RecordingStatusMessage"}, - {0x8000, handle_SPCPRegisterTokenReq , "SPCPRegisterTokenReq"}, - {0x8100, handle_SPCPRegisterTokenAck , "SPCPRegisterTokenAck"}, - {0x8101, handle_SPCPRegisterTokenReject , "SPCPRegisterTokenReject"}, +} skinny_opcode_map_t; + +/* Messages Handler Array */ +static const skinny_opcode_map_t skinny_opcode_map[] = { + {0x0000, NULL , SKINNY_MSGTYPE_REQUEST , "KeepAliveReqMessage"}, + {0x0001, handle_RegisterReqMessage , SKINNY_MSGTYPE_REQUEST , "RegisterReqMessage"}, + {0x0002, handle_IpPortMessage , SKINNY_MSGTYPE_EVENT , "IpPortMessage"}, + {0x0003, handle_KeypadButtonMessage , SKINNY_MSGTYPE_EVENT , "KeypadButtonMessage"}, + {0x0004, handle_EnblocCallMessage , SKINNY_MSGTYPE_EVENT , "EnblocCallMessage"}, + {0x0005, handle_StimulusMessage , SKINNY_MSGTYPE_EVENT , "StimulusMessage"}, + {0x0006, handle_OffHookMessage , SKINNY_MSGTYPE_EVENT , "OffHookMessage"}, + {0x0007, handle_OnHookMessage , SKINNY_MSGTYPE_EVENT , "OnHookMessage"}, + {0x0008, handle_HookFlashMessage , SKINNY_MSGTYPE_EVENT , "HookFlashMessage"}, + {0x0009, handle_ForwardStatReqMessage , SKINNY_MSGTYPE_REQUEST , "ForwardStatReqMessage"}, + {0x000a, handle_SpeedDialStatReqMessage , SKINNY_MSGTYPE_REQUEST , "SpeedDialStatReqMessage"}, + {0x000b, handle_LineStatReqMessage , SKINNY_MSGTYPE_REQUEST , "LineStatReqMessage"}, + {0x000c, NULL , SKINNY_MSGTYPE_REQUEST , "ConfigStatReqMessage"}, + {0x000d, NULL , SKINNY_MSGTYPE_REQUEST , "TimeDateReqMessage"}, + {0x000e, NULL , SKINNY_MSGTYPE_REQUEST , "ButtonTemplateReqMessage"}, + {0x000f, NULL , SKINNY_MSGTYPE_REQUEST , "VersionReqMessage"}, + {0x0010, handle_CapabilitiesResMessage , SKINNY_MSGTYPE_RESPONSE , "CapabilitiesResMessage"}, + {0x0012, NULL , SKINNY_MSGTYPE_REQUEST , "ServerReqMessage"}, + {0x0020, handle_AlarmMessage , SKINNY_MSGTYPE_EVENT , "AlarmMessage"}, + {0x0021, handle_MulticastMediaReceptionAckMessage , SKINNY_MSGTYPE_RESPONSE , "MulticastMediaReceptionAckMessage"}, + {0x0022, handle_OpenReceiveChannelAckMessage , SKINNY_MSGTYPE_RESPONSE , "OpenReceiveChannelAckMessage"}, + {0x0023, handle_ConnectionStatisticsResMessage , SKINNY_MSGTYPE_RESPONSE , "ConnectionStatisticsResMessage"}, + {0x0024, handle_OffHookWithCgpnMessage , SKINNY_MSGTYPE_EVENT , "OffHookWithCgpnMessage"}, + {0x0025, NULL , SKINNY_MSGTYPE_REQUEST , "SoftKeySetReqMessage"}, + {0x0026, handle_SoftKeyEventMessage , SKINNY_MSGTYPE_EVENT , "SoftKeyEventMessage"}, + {0x0027, handle_UnregisterReqMessage , SKINNY_MSGTYPE_REQUEST , "UnregisterReqMessage"}, + {0x0028, NULL , SKINNY_MSGTYPE_REQUEST , "SoftKeyTemplateReqMessage"}, + {0x0029, handle_RegisterTokenReq , SKINNY_MSGTYPE_REQUEST , "RegisterTokenReq"}, + {0x002a, handle_MediaTransmissionFailureMessage , SKINNY_MSGTYPE_RESPONSE , "MediaTransmissionFailureMessage"}, + {0x002b, handle_HeadsetStatusMessage , SKINNY_MSGTYPE_EVENT , "HeadsetStatusMessage"}, + {0x002c, handle_MediaResourceNotificationMessage , SKINNY_MSGTYPE_EVENT , "MediaResourceNotificationMessage"}, + {0x002d, handle_RegisterAvailableLinesMessage , SKINNY_MSGTYPE_EVENT , "RegisterAvailableLinesMessage"}, + {0x002e, handle_DeviceToUserDataMessage , SKINNY_MSGTYPE_REQUEST , "DeviceToUserDataMessage"}, + {0x002f, handle_DeviceToUserDataResponseMessage , SKINNY_MSGTYPE_RESPONSE , "DeviceToUserDataResponseMessage"}, + {0x0030, handle_UpdateCapabilitiesMessage , SKINNY_MSGTYPE_EVENT , "UpdateCapabilitiesMessage"}, + {0x0031, handle_OpenMultiMediaReceiveChannelAckMessage , SKINNY_MSGTYPE_RESPONSE , "OpenMultiMediaReceiveChannelAckMessage"}, + {0x0032, handle_ClearConferenceMessage , SKINNY_MSGTYPE_EVENT , "ClearConferenceMessage"}, + {0x0033, handle_ServiceURLStatReqMessage , SKINNY_MSGTYPE_REQUEST , "ServiceURLStatReqMessage"}, + {0x0034, handle_FeatureStatReqMessage , SKINNY_MSGTYPE_REQUEST , "FeatureStatReqMessage"}, + {0x0035, handle_CreateConferenceResMessage , SKINNY_MSGTYPE_RESPONSE , "CreateConferenceResMessage"}, + {0x0036, handle_DeleteConferenceResMessage , SKINNY_MSGTYPE_RESPONSE , "DeleteConferenceResMessage"}, + {0x0037, handle_ModifyConferenceResMessage , SKINNY_MSGTYPE_RESPONSE , "ModifyConferenceResMessage"}, + {0x0038, handle_AddParticipantResMessage , SKINNY_MSGTYPE_RESPONSE , "AddParticipantResMessage"}, + {0x0039, handle_AuditConferenceResMessage , SKINNY_MSGTYPE_RESPONSE , "AuditConferenceResMessage"}, + {0x0040, handle_AuditParticipantResMessage , SKINNY_MSGTYPE_RESPONSE , "AuditParticipantResMessage"}, + {0x0041, handle_DeviceToUserDataMessageVersion1 , SKINNY_MSGTYPE_REQUEST , "DeviceToUserDataMessageVersion1"}, + {0x0042, handle_DeviceToUserDataResponseMessageVersion1 , SKINNY_MSGTYPE_RESPONSE , "DeviceToUserDataResponseMessageVersion1"}, + {0x0043, handle_CapabilitiesV2ResMessage , SKINNY_MSGTYPE_RESPONSE , "CapabilitiesV2ResMessage"}, + {0x0044, handle_CapabilitiesV3ResMessage , SKINNY_MSGTYPE_RESPONSE , "CapabilitiesV3ResMessage"}, + {0x0045, handle_PortResMessage , SKINNY_MSGTYPE_RESPONSE , "PortResMessage"}, + {0x0046, handle_QoSResvNotifyMessage , SKINNY_MSGTYPE_EVENT , "QoSResvNotifyMessage"}, + {0x0047, handle_QoSErrorNotifyMessage , SKINNY_MSGTYPE_EVENT , "QoSErrorNotifyMessage"}, + {0x0048, handle_SubscriptionStatReqMessage , SKINNY_MSGTYPE_REQUEST , "SubscriptionStatReqMessage"}, + {0x0049, handle_MediaPathEventMessage , SKINNY_MSGTYPE_EVENT , "MediaPathEventMessage"}, + {0x004a, handle_MediaPathCapabilityMessage , SKINNY_MSGTYPE_EVENT , "MediaPathCapabilityMessage"}, + {0x004c, handle_MwiNotificationMessage , SKINNY_MSGTYPE_REQUEST , "MwiNotificationMessage"}, + {0x0081, handle_RegisterAckMessage , SKINNY_MSGTYPE_RESPONSE , "RegisterAckMessage"}, + {0x0082, handle_StartToneMessage , SKINNY_MSGTYPE_EVENT , "StartToneMessage"}, + {0x0083, handle_StopToneMessage , SKINNY_MSGTYPE_EVENT , "StopToneMessage"}, + {0x0085, handle_SetRingerMessage , SKINNY_MSGTYPE_EVENT , "SetRingerMessage"}, + {0x0086, handle_SetLampMessage , SKINNY_MSGTYPE_EVENT , "SetLampMessage"}, + {0x0088, handle_SetSpeakerModeMessage , SKINNY_MSGTYPE_EVENT , "SetSpeakerModeMessage"}, + {0x0089, handle_SetMicroModeMessage , SKINNY_MSGTYPE_EVENT , "SetMicroModeMessage"}, + {0x008a, handle_StartMediaTransmissionMessage , SKINNY_MSGTYPE_REQUEST , "StartMediaTransmissionMessage"}, + {0x008b, handle_StopMediaTransmissionMessage , SKINNY_MSGTYPE_EVENT , "StopMediaTransmissionMessage"}, + {0x008f, handle_CallInfoMessage , SKINNY_MSGTYPE_EVENT , "CallInfoMessage"}, + {0x0090, handle_ForwardStatResMessage , SKINNY_MSGTYPE_RESPONSE , "ForwardStatResMessage"}, + {0x0091, handle_SpeedDialStatResMessage , SKINNY_MSGTYPE_RESPONSE , "SpeedDialStatResMessage"}, + {0x0092, handle_LineStatResMessage , SKINNY_MSGTYPE_RESPONSE , "LineStatResMessage"}, + {0x0093, handle_ConfigStatResMessage , SKINNY_MSGTYPE_RESPONSE , "ConfigStatResMessage"}, + {0x0094, handle_TimeDateResMessage , SKINNY_MSGTYPE_RESPONSE , "TimeDateResMessage"}, + {0x0095, handle_StartSessionTransmissionMessage , SKINNY_MSGTYPE_EVENT , "StartSessionTransmissionMessage"}, + {0x0096, handle_StopSessionTransmissionMessage , SKINNY_MSGTYPE_EVENT , "StopSessionTransmissionMessage"}, + {0x0097, handle_ButtonTemplateResMessage , SKINNY_MSGTYPE_RESPONSE , "ButtonTemplateResMessage"}, + {0x0098, handle_VersionResMessage , SKINNY_MSGTYPE_RESPONSE , "VersionResMessage"}, + {0x0099, handle_DisplayTextMessage , SKINNY_MSGTYPE_EVENT , "DisplayTextMessage"}, + {0x009a, NULL , SKINNY_MSGTYPE_EVENT , "ClearDisplay"}, + {0x009b, NULL , SKINNY_MSGTYPE_EVENT , "CapabilitiesReq"}, + {0x009d, handle_RegisterRejectMessage , SKINNY_MSGTYPE_EVENT , "RegisterRejectMessage"}, + {0x009e, handle_ServerResMessage , SKINNY_MSGTYPE_RESPONSE , "ServerResMessage"}, + {0x009f, handle_Reset , SKINNY_MSGTYPE_EVENT , "Reset"}, + {0x0100, NULL , SKINNY_MSGTYPE_RESPONSE , "KeepAliveAckMessage"}, + {0x0101, handle_StartMulticastMediaReceptionMessage , SKINNY_MSGTYPE_REQUEST , "StartMulticastMediaReceptionMessage"}, + {0x0102, handle_StartMulticastMediaTransmissionMessage , SKINNY_MSGTYPE_REQUEST , "StartMulticastMediaTransmissionMessage"}, + {0x0103, handle_StopMulticastMediaReceptionMessage , SKINNY_MSGTYPE_EVENT , "StopMulticastMediaReceptionMessage"}, + {0x0104, handle_StopMulticastMediaTransmissionMessage , SKINNY_MSGTYPE_EVENT , "StopMulticastMediaTransmissionMessage"}, + {0x0105, handle_OpenReceiveChannelMessage , SKINNY_MSGTYPE_REQUEST , "OpenReceiveChannelMessage"}, + {0x0106, handle_CloseReceiveChannelMessage , SKINNY_MSGTYPE_EVENT , "CloseReceiveChannelMessage"}, + {0x0107, handle_ConnectionStatisticsReqMessage , SKINNY_MSGTYPE_REQUEST , "ConnectionStatisticsReqMessage"}, + {0x0108, handle_SoftKeyTemplateResMessage , SKINNY_MSGTYPE_RESPONSE , "SoftKeyTemplateResMessage"}, + {0x0109, handle_SoftKeySetResMessage , SKINNY_MSGTYPE_RESPONSE , "SoftKeySetResMessage"}, + {0x0110, handle_SelectSoftKeysMessage , SKINNY_MSGTYPE_EVENT , "SelectSoftKeysMessage"}, + {0x0111, handle_CallStateMessage , SKINNY_MSGTYPE_EVENT , "CallStateMessage"}, + {0x0112, handle_DisplayPromptStatusMessage , SKINNY_MSGTYPE_EVENT , "DisplayPromptStatusMessage"}, + {0x0113, handle_ClearPromptStatusMessage , SKINNY_MSGTYPE_EVENT , "ClearPromptStatusMessage"}, + {0x0114, handle_DisplayNotifyMessage , SKINNY_MSGTYPE_EVENT , "DisplayNotifyMessage"}, + {0x0115, NULL , SKINNY_MSGTYPE_EVENT , "ClearNotifyMessage"}, + {0x0116, handle_ActivateCallPlaneMessage , SKINNY_MSGTYPE_EVENT , "ActivateCallPlaneMessage"}, + {0x0117, NULL , SKINNY_MSGTYPE_EVENT , "DeactivateCallPlaneMessage"}, + {0x0118, handle_UnregisterAckMessage , SKINNY_MSGTYPE_RESPONSE , "UnregisterAckMessage"}, + {0x0119, handle_BackSpaceResMessage , SKINNY_MSGTYPE_EVENT , "BackSpaceResMessage"}, + {0x011a, NULL , SKINNY_MSGTYPE_RESPONSE , "RegisterTokenAck"}, + {0x011b, handle_RegisterTokenReject , SKINNY_MSGTYPE_RESPONSE , "RegisterTokenReject"}, + {0x011c, handle_StartMediaFailureDetectionMessage , SKINNY_MSGTYPE_EVENT , "StartMediaFailureDetectionMessage"}, + {0x011d, handle_DialedNumberMessage , SKINNY_MSGTYPE_EVENT , "DialedNumberMessage"}, + {0x011e, handle_UserToDeviceDataMessage , SKINNY_MSGTYPE_EVENT , "UserToDeviceDataMessage"}, + {0x011f, handle_FeatureStatResMessage , SKINNY_MSGTYPE_RESPONSE , "FeatureStatResMessage"}, + {0x0120, handle_DisplayPriNotifyMessage , SKINNY_MSGTYPE_EVENT , "DisplayPriNotifyMessage"}, + {0x0121, handle_ClearPriNotifyMessage , SKINNY_MSGTYPE_EVENT , "ClearPriNotifyMessage"}, + {0x0122, handle_StartAnnouncementMessage , SKINNY_MSGTYPE_EVENT , "StartAnnouncementMessage"}, + {0x0123, handle_StopAnnouncementMessage , SKINNY_MSGTYPE_EVENT , "StopAnnouncementMessage"}, + {0x0124, handle_AnnouncementFinishMessage , SKINNY_MSGTYPE_EVENT , "AnnouncementFinishMessage"}, + {0x0127, handle_NotifyDtmfToneMessage , SKINNY_MSGTYPE_EVENT , "NotifyDtmfToneMessage"}, + {0x0128, handle_SendDtmfToneMessage , SKINNY_MSGTYPE_EVENT , "SendDtmfToneMessage"}, + {0x0129, handle_SubscribeDtmfPayloadReqMessage , SKINNY_MSGTYPE_REQUEST , "SubscribeDtmfPayloadReqMessage"}, + {0x012a, handle_SubscribeDtmfPayloadResMessage , SKINNY_MSGTYPE_RESPONSE , "SubscribeDtmfPayloadResMessage"}, + {0x012b, handle_SubscribeDtmfPayloadErrMessage , SKINNY_MSGTYPE_RESPONSE , "SubscribeDtmfPayloadErrMessage"}, + {0x012c, handle_UnSubscribeDtmfPayloadReqMessage , SKINNY_MSGTYPE_REQUEST , "UnSubscribeDtmfPayloadReqMessage"}, + {0x012d, handle_UnSubscribeDtmfPayloadResMessage , SKINNY_MSGTYPE_RESPONSE , "UnSubscribeDtmfPayloadResMessage"}, + {0x012e, handle_UnSubscribeDtmfPayloadErrMessage , SKINNY_MSGTYPE_RESPONSE , "UnSubscribeDtmfPayloadErrMessage"}, + {0x012f, handle_ServiceURLStatResMessage , SKINNY_MSGTYPE_RESPONSE , "ServiceURLStatResMessage"}, + {0x0130, handle_CallSelectStatResMessage , SKINNY_MSGTYPE_EVENT , "CallSelectStatResMessage"}, + {0x0131, handle_OpenMultiMediaReceiveChannelMessage , SKINNY_MSGTYPE_REQUEST , "OpenMultiMediaReceiveChannelMessage"}, + {0x0132, handle_StartMultiMediaTransmissionMessage , SKINNY_MSGTYPE_REQUEST , "StartMultiMediaTransmissionMessage"}, + {0x0133, handle_StopMultiMediaTransmissionMessage , SKINNY_MSGTYPE_EVENT , "StopMultiMediaTransmissionMessage"}, + {0x0134, handle_MiscellaneousCommandMessage , SKINNY_MSGTYPE_EVENT , "MiscellaneousCommandMessage"}, + {0x0135, handle_FlowControlCommandMessage , SKINNY_MSGTYPE_EVENT , "FlowControlCommandMessage"}, + {0x0136, handle_CloseMultiMediaReceiveChannelMessage , SKINNY_MSGTYPE_EVENT , "CloseMultiMediaReceiveChannelMessage"}, + {0x0137, handle_CreateConferenceReqMessage , SKINNY_MSGTYPE_REQUEST , "CreateConferenceReqMessage"}, + {0x0138, handle_DeleteConferenceReqMessage , SKINNY_MSGTYPE_REQUEST , "DeleteConferenceReqMessage"}, + {0x0139, handle_ModifyConferenceReqMessage , SKINNY_MSGTYPE_REQUEST , "ModifyConferenceReqMessage"}, + {0x013a, handle_AddParticipantReqMessage , SKINNY_MSGTYPE_REQUEST , "AddParticipantReqMessage"}, + {0x013b, handle_DropParticipantReqMessage , SKINNY_MSGTYPE_REQUEST , "DropParticipantReqMessage"}, + {0x013c, NULL , SKINNY_MSGTYPE_REQUEST , "AuditConferenceReqMessage"}, + {0x013d, handle_AuditParticipantReqMessage , SKINNY_MSGTYPE_REQUEST , "AuditParticipantReqMessage"}, + {0x013e, handle_ChangeParticipantReqMessage , SKINNY_MSGTYPE_REQUEST , "ChangeParticipantReqMessage"}, + {0x013f, handle_UserToDeviceDataMessageVersion1 , SKINNY_MSGTYPE_EVENT , "UserToDeviceDataMessageVersion1"}, + {0x0140, handle_VideoDisplayCommandMessage , SKINNY_MSGTYPE_EVENT , "VideoDisplayCommandMessage"}, + {0x0141, handle_FlowControlNotifyMessage , SKINNY_MSGTYPE_EVENT , "FlowControlNotifyMessage"}, + {0x0142, handle_ConfigStatV2ResMessage , SKINNY_MSGTYPE_RESPONSE , "ConfigStatV2ResMessage"}, + {0x0143, handle_DisplayNotifyV2Message , SKINNY_MSGTYPE_EVENT , "DisplayNotifyV2Message"}, + {0x0144, handle_DisplayPriNotifyV2Message , SKINNY_MSGTYPE_EVENT , "DisplayPriNotifyV2Message"}, + {0x0145, handle_DisplayPromptStatusV2Message , SKINNY_MSGTYPE_EVENT , "DisplayPromptStatusV2Message"}, + {0x0146, handle_FeatureStatV2ResMessage , SKINNY_MSGTYPE_RESPONSE , "FeatureStatV2ResMessage"}, + {0x0147, handle_LineStatV2ResMessage , SKINNY_MSGTYPE_RESPONSE , "LineStatV2ResMessage"}, + {0x0148, handle_ServiceURLStatV2ResMessage , SKINNY_MSGTYPE_RESPONSE , "ServiceURLStatV2ResMessage"}, + {0x0149, handle_SpeedDialStatV2ResMessage , SKINNY_MSGTYPE_RESPONSE , "SpeedDialStatV2ResMessage"}, + {0x014a, handle_CallInfoV2Message , SKINNY_MSGTYPE_EVENT , "CallInfoV2Message"}, + {0x014b, handle_PortReqMessage , SKINNY_MSGTYPE_REQUEST , "PortReqMessage"}, + {0x014c, handle_PortCloseMessage , SKINNY_MSGTYPE_EVENT , "PortCloseMessage"}, + {0x014d, handle_QoSListenMessage , SKINNY_MSGTYPE_EVENT , "QoSListenMessage"}, + {0x014e, handle_QoSPathMessage , SKINNY_MSGTYPE_EVENT , "QoSPathMessage"}, + {0x014f, handle_QoSTeardownMessage , SKINNY_MSGTYPE_EVENT , "QoSTeardownMessage"}, + {0x0150, handle_UpdateDSCPMessage , SKINNY_MSGTYPE_EVENT , "UpdateDSCPMessage"}, + {0x0151, handle_QoSModifyMessage , SKINNY_MSGTYPE_EVENT , "QoSModifyMessage"}, + {0x0152, handle_SubscriptionStatResMessage , SKINNY_MSGTYPE_RESPONSE , "SubscriptionStatResMessage"}, + {0x0153, handle_NotificationMessage , SKINNY_MSGTYPE_EVENT , "NotificationMessage"}, + {0x0154, handle_StartMediaTransmissionAckMessage , SKINNY_MSGTYPE_RESPONSE , "StartMediaTransmissionAckMessage"}, + {0x0155, handle_StartMultiMediaTransmissionAckMessage , SKINNY_MSGTYPE_RESPONSE , "StartMultiMediaTransmissionAckMessage"}, + {0x0156, handle_CallHistoryInfoMessage , SKINNY_MSGTYPE_EVENT , "CallHistoryInfoMessage"}, + {0x0157, handle_LocationInfoMessage , SKINNY_MSGTYPE_EVENT , "LocationInfoMessage"}, + {0x0158, handle_MwiResMessage , SKINNY_MSGTYPE_RESPONSE , "MwiResMessage"}, + {0x0159, handle_AddOnDeviceCapabilitiesMessage , SKINNY_MSGTYPE_EVENT , "AddOnDeviceCapabilitiesMessage"}, + {0x015a, handle_EnhancedAlarmMessage , SKINNY_MSGTYPE_EVENT , "EnhancedAlarmMessage"}, + {0x015e, NULL , SKINNY_MSGTYPE_REQUEST , "CallCountReqMessage"}, + {0x015f, handle_CallCountRespMessage , SKINNY_MSGTYPE_RESPONSE , "CallCountRespMessage"}, + {0x0160, handle_RecordingStatusMessage , SKINNY_MSGTYPE_EVENT , "RecordingStatusMessage"}, + {0x8000, handle_SPCPRegisterTokenReq , SKINNY_MSGTYPE_REQUEST , "SPCPRegisterTokenReq"}, + {0x8100, handle_SPCPRegisterTokenAck , SKINNY_MSGTYPE_RESPONSE , "SPCPRegisterTokenAck"}, + {0x8101, handle_SPCPRegisterTokenReject , SKINNY_MSGTYPE_RESPONSE , "SPCPRegisterTokenReject"}, }; /* Dissect a single SKINNY PDU */ @@ -7593,11 +8017,14 @@ static int dissect_skinny_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre guint offset = 0; /*gboolean is_video = FALSE;*/ /* FIX ME: need to indicate video or not */ ptvcursor_t* cursor; + conversation_t *conversation; + skinny_conv_info_t *skinny_conv; + const skinny_opcode_map_t *opcode_entry = NULL; /* Header fields */ guint32 hdr_data_length; guint32 hdr_version; - guint32 data_messageid; + guint32 hdr_opcode; guint16 i; /* Set up structures we will need to add the protocol subtree and manage it */ @@ -7607,9 +8034,29 @@ static int dissect_skinny_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre /* Initialization */ hdr_data_length = tvb_get_letohl(tvb, 0); hdr_version = tvb_get_letohl(tvb, 4); - data_messageid = tvb_get_letohl(tvb, 8); + hdr_opcode = tvb_get_letohl(tvb, 8); + + for (i = 0; i < sizeof(skinny_opcode_map)/sizeof(skinny_opcode_map_t) ; i++) { + if (skinny_opcode_map[i].opcode == hdr_opcode) { + opcode_entry = &skinny_opcode_map[i]; + } + } + + conversation = find_or_create_conversation(pinfo); + skinny_conv = (skinny_conv_info_t *)conversation_get_proto_data(conversation, proto_skinny); + if (!skinny_conv) { + skinny_conv = wmem_new0(wmem_file_scope(), skinny_conv_info_t); + //skinny_conv->pending_req_resp = wmem_map_new(wmem_file_scope(), wmem_str_hash, g_str_equal); + skinny_conv->pending_req_resp = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal); + skinny_conv->requests = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal); + skinny_conv->responses = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal); + skinny_conv->lineId = -1; + skinny_conv->mtype = SKINNY_MSGTYPE_EVENT; + conversation_add_proto_data(conversation, proto_skinny, skinny_conv); + } /* Initialise stat info for passing to tap */ + /* WIP: will be (partially) replaced in favor of conversionation, dependents: ui/voip_calls.c */ pi_current++; if (pi_current == MAX_SKINNY_MESSAGES_IN_PACKET) { @@ -7617,13 +8064,12 @@ static int dissect_skinny_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre pi_current = 0; } si = &pi_arr[pi_current]; - si->messId = data_messageid; - si->messageName = val_to_str_ext(data_messageid, &message_id_ext, "0x%08X (Unknown)"); + si->messId = hdr_opcode; + si->messageName = val_to_str_ext(hdr_opcode, &message_id_ext, "0x%08X (Unknown)"); si->callId = 0; - si->lineId = -1; + si->lineId = 0; si->passThruId = 0; si->callState = 0; - si->hasCallInfo = FALSE; g_free(si->callingParty); si->callingParty = NULL; g_free(si->calledParty); @@ -7634,27 +8080,33 @@ static int dissect_skinny_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre si->multimediaTransmissionStatus = -1; si->multicastReceptionStatus = -1; - /* In the interest of speed, if "tree" is NULL, don't do any work not - * necessary to generate protocol tree items. - */ - if (tree) { - ti = proto_tree_add_item(tree, proto_skinny, tvb, offset, hdr_data_length+8, ENC_NA); - skinny_tree = proto_item_add_subtree(ti, ett_skinny); - proto_tree_add_uint(skinny_tree, hf_skinny_data_length, tvb, offset, 4, hdr_data_length); - proto_tree_add_uint(skinny_tree, hf_skinny_hdr_version, tvb, offset+4, 4, hdr_version); - } - col_add_fstr(pinfo->cinfo, COL_INFO,"%s ", si->messageName); col_set_fence(pinfo->cinfo, COL_INFO); - proto_tree_add_uint(skinny_tree, hf_skinny_messageId, tvb,offset+8, 4, data_messageid ); + if (tree) { + ti = proto_tree_add_item(tree, proto_skinny, tvb, offset, hdr_data_length+8, ENC_NA); + skinny_tree = proto_item_add_subtree(ti, ett_skinny); + } + + if (opcode_entry && opcode_entry->type != SKINNY_MSGTYPE_EVENT) { + skinny_conv->mtype = opcode_entry->type; + if (opcode_entry->type == SKINNY_MSGTYPE_REQUEST) { + col_set_str(pinfo->cinfo, COL_PROTOCOL, "SKINNY/REQ"); + } else { + col_set_str(pinfo->cinfo, COL_PROTOCOL, "SKINNY/RESP"); + } + } + + if (skinny_tree) { + proto_tree_add_uint(skinny_tree, hf_skinny_data_length, tvb, offset , 4, hdr_data_length); + proto_tree_add_uint(skinny_tree, hf_skinny_hdr_version, tvb, offset+4, 4, hdr_version); + proto_tree_add_uint(skinny_tree, hf_skinny_messageId, tvb, offset+8, 4, hdr_opcode ); + } offset += 12; cursor = ptvcursor_new(skinny_tree, tvb, offset); - for (i = 0; i < sizeof(skinny_opcode2handler)/sizeof(struct opcode2handler) ; i++) { - if (skinny_opcode2handler[i].opcode == data_messageid && skinny_opcode2handler[i].handler) { - skinny_opcode2handler[i].handler(cursor, pinfo); - } + if (opcode_entry && opcode_entry->handler) { + opcode_entry->handler(cursor, pinfo, skinny_conv); } ptvcursor_free(cursor); @@ -7741,6 +8193,18 @@ proto_register_skinny(void) { "IPv4or6", "skinny.ipv4or6", FT_UINT32, BASE_DEC|BASE_EXT_STRING, &IpAddrType_ext, 0x0, NULL, HFILL }}, + { &hf_skinny_response_in, + { + "Response In", "skinny.response_in", FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE), 0x0, + "The response to this SKINNY request is in this frame", HFILL }}, + { &hf_skinny_response_to, + { + "Request In", "skinny.response_to", FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST), 0x0, + "This is a response to the SKINNY request in this frame", HFILL }}, + { &hf_skinny_response_time, + { + "Response Time", "skinny.response_time", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, + "The time between the Call and the Reply", HFILL }}, { &hf_skinny_CallingPartyName, { "CallingName", "skinny.CallingPartyName", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x0008, @@ -8557,6 +9021,10 @@ proto_register_skinny(void) { "none", "skinny.none", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_skinny_notificationStatus, + { + "notificationStatus", "skinny.notificationStatus", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, { &hf_skinny_nse, { "nse", "skinny.nse", FT_UINT8, BASE_DEC, NULL, 0x0, @@ -8649,9 +9117,9 @@ proto_register_skinny(void) { "partyDirection", "skinny.partyDirection", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_skinny_passThruPartyID, + { &hf_skinny_passThruPartyId, { - "passThruPartyID", "skinny.passThruPartyID", FT_UINT32, BASE_DEC, NULL, 0x0, + "passThruPartyId", "skinny.passThruPartyId", FT_UINT32, BASE_DEC, NULL, 0x0, "PassThrough PartyId", HFILL }}, { &hf_skinny_passthruPartyID, { @@ -9489,10 +9957,6 @@ proto_register_skinny(void) { "subscriptionID", "skinny.subscriptionID", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, - {&hf_skinny_subscriptionoFeatureID, - { - "subscriptionoFeatureID", "skinny.subscriptionoFeatureID", FT_UINT32, BASE_HEX | BASE_EXT_STRING, &SubscriptionFeatureID_ext, 0x0, - NULL, HFILL }}, {&hf_skinny_text, { "text", "skinny.text", FT_STRING, BASE_NONE, NULL, 0x0, diff --git a/epan/dissectors/packet-skinny.c.in b/epan/dissectors/packet-skinny.c.in index 961c1b717c..865a27d3ab 100644 --- a/epan/dissectors/packet-skinny.c.in +++ b/epan/dissectors/packet-skinny.c.in @@ -59,6 +59,9 @@ cog.out(' */\n') #include #include +#include +#include +#include #include #include #include @@ -68,6 +71,10 @@ cog.out(' */\n') #include "packet-ssl.h" #include "packet-skinny.h" +/* un-comment the following as well as this line in conversation.c, to enable debug printing */ +/* #define DEBUG_CONVERSATION */ +#include "conversation_debug.h" + void proto_register_skinny(void); void proto_reg_handoff_skinny(void); @@ -113,7 +120,7 @@ global message_dissector_functions message_dissector_functions = '' skinny = xml2skinny.xml2obj(xmlfile) -cog.out('static const value_string message_id[] = {\n') +cog.out('static const value_string message_id[] = {\n') for message in skinny.message: message_dissector_functions += '%s' %message.dissect() cog.out(' { %s, "%s" },\n' %(message.opcode, message.name.replace('Message',''))) @@ -123,7 +130,6 @@ cog.out('static value_string_ext message_id_ext = VALUE_STRING_EXT_INIT(message_ ]]]*/ /*[[[end]]]*/ - /* Declare Enums and Defines */ /* [[[cog for enum in skinny.enum: @@ -156,6 +162,9 @@ static int hf_skinny_data_length = -1; static int hf_skinny_hdr_version = -1; static int hf_skinny_xmlData = -1; static int hf_skinny_ipv4or6 = -1; +static int hf_skinny_response_in = -1; +static int hf_skinny_response_to = -1; +static int hf_skinny_response_time = -1; /* [[[cog for key in sorted(xml2skinny.fieldsArray.keys()): @@ -305,23 +314,93 @@ dissect_skinny_displayLabel(ptvcursor_t *cursor, int hfindex, gint length) ptvcursor_advance(cursor, length); } -/*** Messages Handlers ***/ +/*** Request / Response helper functions */ +static void skinny_reqrep_add_request(ptvcursor_t *cursor, packet_info * pinfo, skinny_conv_info_t * skinny_conv, const int request_key) +{ + proto_tree *tree = ptvcursor_tree(cursor); + tvbuff_t *tvb = ptvcursor_tvbuff(cursor); + skinny_req_resp_t *req_resp = NULL; + if (!PINFO_FD_VISITED(pinfo)) { + req_resp = wmem_new0(wmem_file_scope(), skinny_req_resp_t); + req_resp->request_frame = pinfo->num; + req_resp->response_frame = 0; + req_resp->request_time = pinfo->fd->abs_ts; + wmem_map_insert(skinny_conv->pending_req_resp, GINT_TO_POINTER(request_key), (void *)req_resp); + DPRINT(("SKINNY: setup_request: frame=%d add key=%d to map\n", pinfo->num, request_key)); + } + + req_resp = (skinny_req_resp_t *) wmem_map_lookup(skinny_conv->requests, GUINT_TO_POINTER(pinfo->num)); + if (req_resp && req_resp->response_frame) { + DPRINT(("SKINNY: show request in tree: frame/key=%d\n", pinfo->num)); + proto_item *it; + it = proto_tree_add_uint(tree, hf_skinny_response_in, tvb, 0, 0, req_resp->response_frame); + PROTO_ITEM_SET_GENERATED(it); + } else { + DPRINT(("SKINNY: no request found for frame/key=%d\n", pinfo->num)); + } +} + + +static void skinny_reqrep_add_response(ptvcursor_t *cursor, packet_info * pinfo, skinny_conv_info_t * skinny_conv, const int request_key) +{ + proto_tree *tree = ptvcursor_tree(cursor); + tvbuff_t *tvb = ptvcursor_tvbuff(cursor); + skinny_req_resp_t *req_resp = NULL; + + if (!PINFO_FD_VISITED(pinfo)) { + req_resp = (skinny_req_resp_t *) wmem_map_remove(skinny_conv->pending_req_resp, GINT_TO_POINTER(request_key)); + if (req_resp) { + DPRINT(("SKINNY: match request:%d with response:%d for key=%d\n", req_resp->request_frame, pinfo->num, request_key)); + req_resp->response_frame = pinfo->num; + wmem_map_insert(skinny_conv->requests, GUINT_TO_POINTER(req_resp->request_frame), (void *)req_resp); + wmem_map_insert(skinny_conv->responses, GUINT_TO_POINTER(pinfo->num), (void *)req_resp); + } else { + DPRINT(("SKINNY: no match found for reponse frame=%d and key=%d\n", pinfo->num, request_key)); + } + } + + req_resp = (skinny_req_resp_t *) wmem_map_lookup(skinny_conv->responses, GUINT_TO_POINTER(pinfo->num)); + if (req_resp && req_resp->request_frame) { + DPRINT(("SKINNY: show response in tree: frame/key=%d\n", pinfo->num)); + proto_item *it; + nstime_t ns; + it = proto_tree_add_uint(tree, hf_skinny_response_to, tvb, 0, 0, req_resp->request_frame); + PROTO_ITEM_SET_GENERATED(it); + + nstime_delta(&ns, &pinfo->fd->abs_ts, &req_resp->request_time); + it = proto_tree_add_time(tree, hf_skinny_response_time, tvb, 0, 0, &ns); + PROTO_ITEM_SET_GENERATED(it); + } else { + DPRINT(("SKINNY: no response found for frame/key=%d\n", pinfo->num)); + } +} + +/*** Messages Handlers ***/ /* [[[cog cog.out(message_dissector_functions) ]]]*/ /*[[[end]]]*/ +typedef void (*message_handler) (ptvcursor_t * cursor, packet_info *pinfo, skinny_conv_info_t * skinny_conv); + +typedef struct _skinny_opcode_map_t { + guint32 opcode; + message_handler handler; + skinny_message_type_t type; + const char *name; +} skinny_opcode_map_t; + /* Messages Handler Array */ /* [[[cog -cog.out('typedef void (*message_handler) (ptvcursor_t * cursor, packet_info *pinfo);\n') -cog.out('static const struct opcode2handler {\n') -cog.out(' guint16 opcode;\n'); -cog.out(' message_handler handler;\n'); -cog.out(' const char *name;\n'); -cog.out('} skinny_opcode2handler[] = {\n') +cog.out('static const skinny_opcode_map_t skinny_opcode_map[] = {\n') for message in skinny.message: - cog.out(' {%-6s, %-47s, "%s"},\n' %(message.opcode, message.gen_handler(), message.name)) + msg_type = "SKINNY_MSGTYPE_EVENT" + if message.msgtype == "request": + msg_type = "SKINNY_MSGTYPE_REQUEST" + if message.msgtype == "response" and message.request is not None: + msg_type = "SKINNY_MSGTYPE_RESPONSE" + cog.out(' {%-6s, %-47s, %-24s, "%s"},\n' %(message.opcode, message.gen_handler(), msg_type, message.name)) cog.out('};\n') ]]]*/ /*[[[end]]]*/ @@ -332,11 +411,14 @@ static int dissect_skinny_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre guint offset = 0; /*gboolean is_video = FALSE;*/ /* FIX ME: need to indicate video or not */ ptvcursor_t* cursor; + conversation_t *conversation; + skinny_conv_info_t *skinny_conv; + const skinny_opcode_map_t *opcode_entry = NULL; /* Header fields */ guint32 hdr_data_length; guint32 hdr_version; - guint32 data_messageid; + guint32 hdr_opcode; guint16 i; /* Set up structures we will need to add the protocol subtree and manage it */ @@ -346,9 +428,29 @@ static int dissect_skinny_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre /* Initialization */ hdr_data_length = tvb_get_letohl(tvb, 0); hdr_version = tvb_get_letohl(tvb, 4); - data_messageid = tvb_get_letohl(tvb, 8); + hdr_opcode = tvb_get_letohl(tvb, 8); + + for (i = 0; i < sizeof(skinny_opcode_map)/sizeof(skinny_opcode_map_t) ; i++) { + if (skinny_opcode_map[i].opcode == hdr_opcode) { + opcode_entry = &skinny_opcode_map[i]; + } + } + + conversation = find_or_create_conversation(pinfo); + skinny_conv = (skinny_conv_info_t *)conversation_get_proto_data(conversation, proto_skinny); + if (!skinny_conv) { + skinny_conv = wmem_new0(wmem_file_scope(), skinny_conv_info_t); + //skinny_conv->pending_req_resp = wmem_map_new(wmem_file_scope(), wmem_str_hash, g_str_equal); + skinny_conv->pending_req_resp = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal); + skinny_conv->requests = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal); + skinny_conv->responses = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal); + skinny_conv->lineId = -1; + skinny_conv->mtype = SKINNY_MSGTYPE_EVENT; + conversation_add_proto_data(conversation, proto_skinny, skinny_conv); + } /* Initialise stat info for passing to tap */ + /* WIP: will be (partially) replaced in favor of conversionation, dependents: ui/voip_calls.c */ pi_current++; if (pi_current == MAX_SKINNY_MESSAGES_IN_PACKET) { @@ -356,13 +458,12 @@ static int dissect_skinny_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre pi_current = 0; } si = &pi_arr[pi_current]; - si->messId = data_messageid; - si->messageName = val_to_str_ext(data_messageid, &message_id_ext, "0x%08X (Unknown)"); + si->messId = hdr_opcode; + si->messageName = val_to_str_ext(hdr_opcode, &message_id_ext, "0x%08X (Unknown)"); si->callId = 0; - si->lineId = -1; + si->lineId = 0; si->passThruId = 0; si->callState = 0; - si->hasCallInfo = FALSE; g_free(si->callingParty); si->callingParty = NULL; g_free(si->calledParty); @@ -373,27 +474,33 @@ static int dissect_skinny_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre si->multimediaTransmissionStatus = -1; si->multicastReceptionStatus = -1; - /* In the interest of speed, if "tree" is NULL, don't do any work not - * necessary to generate protocol tree items. - */ - if (tree) { - ti = proto_tree_add_item(tree, proto_skinny, tvb, offset, hdr_data_length+8, ENC_NA); - skinny_tree = proto_item_add_subtree(ti, ett_skinny); - proto_tree_add_uint(skinny_tree, hf_skinny_data_length, tvb, offset, 4, hdr_data_length); - proto_tree_add_uint(skinny_tree, hf_skinny_hdr_version, tvb, offset+4, 4, hdr_version); - } - col_add_fstr(pinfo->cinfo, COL_INFO,"%s ", si->messageName); col_set_fence(pinfo->cinfo, COL_INFO); - proto_tree_add_uint(skinny_tree, hf_skinny_messageId, tvb,offset+8, 4, data_messageid ); + if (tree) { + ti = proto_tree_add_item(tree, proto_skinny, tvb, offset, hdr_data_length+8, ENC_NA); + skinny_tree = proto_item_add_subtree(ti, ett_skinny); + } + + if (opcode_entry && opcode_entry->type != SKINNY_MSGTYPE_EVENT) { + skinny_conv->mtype = opcode_entry->type; + if (opcode_entry->type == SKINNY_MSGTYPE_REQUEST) { + col_set_str(pinfo->cinfo, COL_PROTOCOL, "SKINNY/REQ"); + } else { + col_set_str(pinfo->cinfo, COL_PROTOCOL, "SKINNY/RESP"); + } + } + + if (skinny_tree) { + proto_tree_add_uint(skinny_tree, hf_skinny_data_length, tvb, offset , 4, hdr_data_length); + proto_tree_add_uint(skinny_tree, hf_skinny_hdr_version, tvb, offset+4, 4, hdr_version); + proto_tree_add_uint(skinny_tree, hf_skinny_messageId, tvb, offset+8, 4, hdr_opcode ); + } offset += 12; cursor = ptvcursor_new(skinny_tree, tvb, offset); - for (i = 0; i < sizeof(skinny_opcode2handler)/sizeof(struct opcode2handler) ; i++) { - if (skinny_opcode2handler[i].opcode == data_messageid && skinny_opcode2handler[i].handler) { - skinny_opcode2handler[i].handler(cursor, pinfo); - } + if (opcode_entry && opcode_entry->handler) { + opcode_entry->handler(cursor, pinfo, skinny_conv); } ptvcursor_free(cursor); @@ -480,6 +587,18 @@ proto_register_skinny(void) { "IPv4or6", "skinny.ipv4or6", FT_UINT32, BASE_DEC|BASE_EXT_STRING, &IpAddrType_ext, 0x0, NULL, HFILL }}, + { &hf_skinny_response_in, + { + "Response In", "skinny.response_in", FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE), 0x0, + "The response to this SKINNY request is in this frame", HFILL }}, + { &hf_skinny_response_to, + { + "Request In", "skinny.response_to", FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST), 0x0, + "This is a response to the SKINNY request in this frame", HFILL }}, + { &hf_skinny_response_time, + { + "Response Time", "skinny.response_time", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, + "The time between the Call and the Reply", HFILL }}, /* [[[cog for valuestr in sorted(xml2skinny.fieldsArray.values()): cog.out('%s' %valuestr) diff --git a/epan/dissectors/packet-skinny.h b/epan/dissectors/packet-skinny.h index 2348e2e0f6..6e71e04acf 100644 --- a/epan/dissectors/packet-skinny.h +++ b/epan/dissectors/packet-skinny.h @@ -37,24 +37,55 @@ * cog.py -D xmlfile=tools/SkinnyProtocolOptimized.xml -d -c -o epan/dissectors/packet-skinny.c epan/dissectors/packet-skinny.c.in */ -/* Container for tapping relevant data */ +#include + +/* request response tracking */ +typedef struct _skinny_req_resp_t { + guint32 request_frame; + guint32 response_frame; + nstime_t request_time; +} skinny_req_resp_t; + +/* begin conversaton info*/ +typedef enum _skinny_message_type_t { + SKINNY_MSGTYPE_EVENT = 0, + SKINNY_MSGTYPE_REQUEST = 1, + SKINNY_MSGTYPE_RESPONSE = 2, +} skinny_message_type_t; + +typedef struct _skinny_conv_info_t { + skinny_message_type_t mtype; + wmem_map_t * pending_req_resp; + wmem_map_t * requests; + wmem_map_t * responses; + gint32 lineId; + //guint32 callId; + //guint32 passThruId; + //guint32 transactionId; + //guint32 callState; +} skinny_conv_info_t; +/* end conversation info */ + +/* Containers for tapping relevant data */ +/* WIP: will be (partially) replaced in favor of conversionation, dependents: ui/voip_calls.c */ typedef struct _skinny_info_t { - guint32 messId; - guint32 maxProtocolVersion; - gint32 lineId; - guint32 callId; - guint32 passThruId; - const gchar * messageName; - guint32 callState; - gboolean hasCallInfo; - gchar * callingParty; - gchar * calledParty; - gint32 mediaReceptionStatus; - gint32 mediaTransmissionStatus; - gint32 multimediaReceptionStatus; - gint32 multimediaTransmissionStatus; - gint32 multicastReceptionStatus; + guint32 messId; + guint32 maxProtocolVersion; + gint32 lineId; + guint32 callId; + guint32 passThruId; + const gchar * messageName; + guint32 callState; + gboolean hasCallInfo; + gchar * callingParty; + gchar * calledParty; + gint32 mediaReceptionStatus; + gint32 mediaTransmissionStatus; + gint32 multimediaReceptionStatus; + gint32 multimediaTransmissionStatus; + gint32 multicastReceptionStatus; + //skinny_conv_info_t * skinny_conv; } skinny_info_t; /* diff --git a/epan/dissectors/packet-skinny.h.in b/epan/dissectors/packet-skinny.h.in index 0ef076ab05..368c2e5c96 100644 --- a/epan/dissectors/packet-skinny.h.in +++ b/epan/dissectors/packet-skinny.h.in @@ -49,24 +49,55 @@ cog.out(' */\n') /*]]]*/ /*[[[end]]]*/ -/* Container for tapping relevant data */ +#include + +/* request response tracking */ +typedef struct _skinny_req_resp_t { + guint32 request_frame; + guint32 response_frame; + nstime_t request_time; +} skinny_req_resp_t; + +/* begin conversaton info*/ +typedef enum _skinny_message_type_t { + SKINNY_MSGTYPE_EVENT = 0, + SKINNY_MSGTYPE_REQUEST = 1, + SKINNY_MSGTYPE_RESPONSE = 2, +} skinny_message_type_t; + +typedef struct _skinny_conv_info_t { + skinny_message_type_t mtype; + wmem_map_t * pending_req_resp; + wmem_map_t * requests; + wmem_map_t * responses; + gint32 lineId; + //guint32 callId; + //guint32 passThruId; + //guint32 transactionId; + //guint32 callState; +} skinny_conv_info_t; +/* end conversation info */ + +/* Containers for tapping relevant data */ +/* WIP: will be (partially) replaced in favor of conversionation, dependents: ui/voip_calls.c */ typedef struct _skinny_info_t { - guint32 messId; - guint32 maxProtocolVersion; - gint32 lineId; - guint32 callId; - guint32 passThruId; - const gchar * messageName; - guint32 callState; - gboolean hasCallInfo; - gchar * callingParty; - gchar * calledParty; - gint32 mediaReceptionStatus; - gint32 mediaTransmissionStatus; - gint32 multimediaReceptionStatus; - gint32 multimediaTransmissionStatus; - gint32 multicastReceptionStatus; + guint32 messId; + guint32 maxProtocolVersion; + gint32 lineId; + guint32 callId; + guint32 passThruId; + const gchar * messageName; + guint32 callState; + gboolean hasCallInfo; + gchar * callingParty; + gchar * calledParty; + gint32 mediaReceptionStatus; + gint32 mediaTransmissionStatus; + gint32 multimediaReceptionStatus; + gint32 multimediaTransmissionStatus; + gint32 multicastReceptionStatus; + //skinny_conv_info_t * skinny_conv; } skinny_info_t; /* diff --git a/tools/SkinnyProtocolOptimized.xml b/tools/SkinnyProtocolOptimized.xml index e4d57a7808..1b3cf6da8e 100644 --- a/tools/SkinnyProtocolOptimized.xml +++ b/tools/SkinnyProtocolOptimized.xml @@ -274,7 +274,7 @@ - + @@ -429,7 +429,7 @@ - + @@ -502,12 +502,12 @@ - + - + @@ -516,7 +516,7 @@ - + @@ -575,7 +575,7 @@ - + @@ -583,43 +583,43 @@ - + - + - + - + - + - + - + - + - + - - - - + + + + @@ -701,7 +701,7 @@ - + @@ -745,7 +745,7 @@ - + @@ -758,7 +758,7 @@ - + @@ -772,10 +772,10 @@ - + - + @@ -804,12 +804,12 @@ - + - + @@ -821,20 +821,20 @@ - + - + - + - + @@ -851,14 +851,14 @@ - + - + @@ -969,7 +969,7 @@ - + @@ -982,13 +982,13 @@ - + - - + + @@ -1002,10 +1002,10 @@ - + - + @@ -1017,12 +1017,12 @@ - + - + @@ -1030,7 +1030,7 @@ - + @@ -1042,7 +1042,7 @@ - + @@ -1056,7 +1056,7 @@ - + @@ -1093,7 +1093,7 @@ - + @@ -1255,32 +1255,29 @@ - + - - - - + - + - + - + - + - + @@ -1294,9 +1291,9 @@ - + - + @@ -1309,9 +1306,9 @@ - + - + @@ -1326,9 +1323,9 @@ - + - + @@ -1343,9 +1340,9 @@ - + - + @@ -1357,7 +1354,7 @@ - + @@ -1380,16 +1377,16 @@ - + - + - + @@ -1408,7 +1405,7 @@ - + @@ -1427,7 +1424,7 @@ - + @@ -1606,7 +1603,7 @@ - + @@ -1791,11 +1788,11 @@ - + - - + + @@ -1811,11 +1808,11 @@ - + - + @@ -1859,11 +1856,11 @@ - + - + @@ -1879,9 +1876,9 @@ - + - + @@ -1900,7 +1897,7 @@ - + @@ -1913,13 +1910,13 @@ - + - + @@ -1950,7 +1947,7 @@ - + @@ -2098,7 +2095,7 @@ - + @@ -2106,7 +2103,7 @@ - + @@ -2131,7 +2128,7 @@ - + @@ -2148,7 +2145,7 @@ - + @@ -2161,7 +2158,7 @@ - + @@ -2172,7 +2169,7 @@ - + @@ -2194,10 +2191,10 @@ - + - + @@ -2295,10 +2292,10 @@ - + - + @@ -2336,7 +2333,7 @@ - + @@ -2376,10 +2373,10 @@ - + - + @@ -2388,23 +2385,23 @@ - + - + - + - + - + @@ -2419,7 +2416,7 @@ - + @@ -2445,13 +2442,13 @@ - + - + @@ -2517,7 +2514,7 @@ - + @@ -2534,24 +2531,24 @@ - + - + - - - + + + - + @@ -2582,22 +2579,22 @@ - + - + - + - + @@ -2628,10 +2625,10 @@ - + - + @@ -2665,24 +2662,24 @@ - + - + - + - + - + - + @@ -2777,15 +2774,15 @@ - + - + - + @@ -2793,11 +2790,11 @@ - + - + @@ -2888,7 +2885,7 @@ - + @@ -2925,7 +2922,7 @@ - + @@ -2982,7 +2979,7 @@ - + @@ -2996,7 +2993,7 @@ - + @@ -3004,25 +3001,25 @@ - + - + - - + + - + @@ -3030,27 +3027,27 @@ - + - + - - + + - + - + @@ -3079,7 +3076,7 @@ - + @@ -3091,7 +3088,7 @@ - + @@ -3105,22 +3102,22 @@ - + - + - + - + @@ -3138,7 +3135,7 @@ - + @@ -3154,7 +3151,7 @@ - + @@ -3165,27 +3162,27 @@ - + - + - + - + @@ -3193,60 +3190,60 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -3397,10 +3394,10 @@ - + - + @@ -3545,10 +3542,10 @@ - + - + @@ -3565,7 +3562,7 @@ - + @@ -3627,7 +3624,7 @@ - + @@ -3635,17 +3632,17 @@ - + - + - + - + @@ -3655,14 +3652,14 @@ - + - + - + - + @@ -3671,9 +3668,9 @@ - + - + @@ -3697,21 +3694,21 @@ - + - + - - + + - + - + - + @@ -3735,7 +3732,7 @@ - + @@ -3754,14 +3751,14 @@ - + - + @@ -3769,7 +3766,7 @@ - + @@ -3784,20 +3781,20 @@ - + - + - + @@ -3805,7 +3802,7 @@ - + @@ -3821,9 +3818,9 @@ - + - + @@ -3837,19 +3834,19 @@ - + - + - + - + - + @@ -3901,21 +3898,21 @@ - + - + - + - + @@ -3926,11 +3923,11 @@ - + - + @@ -3953,11 +3950,11 @@ - + - + @@ -3979,31 +3976,31 @@ - + - + - + - + - + - + @@ -4032,36 +4029,36 @@ - + - - + + - + - + - + - + - + - + @@ -4077,14 +4074,14 @@ - + - + @@ -4100,13 +4097,13 @@ - + - + @@ -4114,13 +4111,13 @@ - + - - + + @@ -4139,13 +4136,13 @@ - + - + @@ -4159,12 +4156,12 @@ - + - + diff --git a/tools/parse_xml2skinny_dissector.py b/tools/parse_xml2skinny_dissector.py index d6fea70be0..8acb50fdba 100755 --- a/tools/parse_xml2skinny_dissector.py +++ b/tools/parse_xml2skinny_dissector.py @@ -128,6 +128,14 @@ def xml2obj(src): def getfieldnames(self): return '' + def get_req_resp_keys(self, req_resp_keys): + return [] + + def get_req_resp_key(self): + if self.req_resp_key == "1": + return self.name + return None + def declaration(self): global fieldsArray if self.name not in fieldsArray: @@ -177,16 +185,18 @@ def xml2obj(src): ret += self.indent_out("/*\n") ret += self.indent_out(" * Message: %s\n" %self.name) ret += self.indent_out(" * Opcode: %s\n" %self.opcode) - ret += self.indent_out(" * Type: %s\n" %self.type) + ret += self.indent_out(" * Type: %s\n" %self.type) ret += self.indent_out(" * Direction: %s\n" %self.direction) ret += self.indent_out(" * VarLength: %s\n" %self.dynamic) + ret += self.indent_out(" * MsgType: %s\n" %self.msgtype) if self.comment: ret += self.indent_out(" * Comment: %s\n" %self.comment) ret += self.indent_out(" */\n") ret += self.indent_out("static void\n") - ret += self.indent_out("handle_%s(ptvcursor_t *cursor, packet_info * pinfo _U_)\n" %self.name) + ret += self.indent_out("handle_%s(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_)\n" %self.name) ret += self.indent_out("{\n") self.incr_indent() + for fields in self.fields: if fields.size_lt or fields.size_gt: if self.basemessage.declared is None or "hdr_data_length" not in self.basemessage.declared: @@ -202,7 +212,10 @@ def xml2obj(src): ret += self.indent_out("guint32 hdr_version = tvb_get_letohl(ptvcursor_tvbuff(cursor), 4);\n") self.basemessage.declared.append("hdr_version") declarations += 1 + + req_resp_keys = [] for fields in self.fields: + fields.get_req_resp_keys(req_resp_keys) ret += '%s' %fields.declaration() declarations += 1 @@ -213,6 +226,19 @@ def xml2obj(src): for fields in self.fields: ret += '%s' %fields.dissect() + # setup request/response + if self.msgtype == "request": + if req_resp_keys and req_resp_keys[0] != '': + ret += self.indent_out('skinny_reqrep_add_request(cursor, pinfo, skinny_conv, %s ^ %s);\n' %(self.opcode, req_resp_keys[0])) + else: + ret += self.indent_out('skinny_reqrep_add_request(cursor, pinfo, skinny_conv, %s);\n' %(self.opcode)) + + if self.msgtype == "response": + if req_resp_keys and req_resp_keys[0] != '': + ret += self.indent_out('skinny_reqrep_add_response(cursor, pinfo, skinny_conv, %s ^ %s);\n' %(self.request, req_resp_keys[0])) + else: + ret += self.indent_out('skinny_reqrep_add_response(cursor, pinfo, skinny_conv, %s);\n' %(self.request)) + self.decr_indent() ret += "}\n\n" @@ -222,6 +248,12 @@ def xml2obj(src): ''' Fields ''' size_fieldnames= [] + def get_req_resp_keys(self, req_resp): + for field in self._children: + key = field.get_req_resp_key() + if not key is None and not key in req_resp: + req_resp.append(key) + def declaration(self): ret = '' @@ -474,6 +506,11 @@ def xml2obj(src): def __str__(self): return '%s:%s' %(self.__class__,self.name) + def get_req_resp_key(self): + if self.req_resp_key == "1": + return 'wmem_str_hash(%s)' %self.name + return None + def declaration(self): ret = '' self.intsize = 0 @@ -494,10 +531,10 @@ def xml2obj(src): self.basemessage.declared.append("hdr_version") ret += self.indent_out('guint32 VariableDirnumSize = (hdr_version >= V18_MSG_TYPE) ? 25 : 24;\n') self.basemessage.declared.append("VariableDirnumSize") - else: - if self.basemessage.declared is None or self.name not in self.basemessage.declared: - ret += self.indent_out('guint32 %s = 0;\n' %self.name) - self.basemessage.declared.append(self.name) + #else: + # if self.basemessage.declared is None or self.name not in self.basemessage.declared: + # ret += self.indent_out('gchar *%s = NULL;\n' %self.name) + # self.basemessage.declared.append(self.name) if self.basemessage.dynamic == "yes" and not self.subtype == "DisplayLabel": if self.basemessage.declared is None or self.name + '_len' not in self.basemessage.declared: @@ -513,7 +550,7 @@ def xml2obj(src): ret = '' if self.declare == "yes" and self.size != "VariableDirnumSize": - ret += self.indent_out('%s = tvb_get_letohl(ptvcursor_tvbuff(cursor), 4);\n' %self.name) + ret += self.indent_out('const gchar * %s = g_strdup(tvb_format_stringzpad(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor), %s));\n' %(self.name, self.size)) if self.subtype == "DisplayLabel": if self.basemessage.dynamic == "yes":