diff options
author | Lars Roland <Lars.Roland@gmx.net> | 2005-02-01 12:12:35 +0000 |
---|---|---|
committer | Lars Roland <Lars.Roland@gmx.net> | 2005-02-01 12:12:35 +0000 |
commit | 197ceddab109a59288f0b0d868df2f5e6adb4da2 (patch) | |
tree | 6dc104c87f777e4ffe6cfba24b8c5ccca2dfcbe4 /asn1 | |
parent | db69eb8c13136402095a66f5069c32e3ab37520a (diff) |
From Alejandro Vaquero:
h323 taps support up to 5 messages per packet now.
VoIP call analysis:
- Collect ISUP, SIP and H323 calls from a capture and show them in window with the following info:
- Start and Stop time of the call
- Init
svn path=/trunk/; revision=13225
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/h225/h225.cnf | 116 | ||||
-rw-r--r-- | asn1/h225/packet-h225-template.c | 33 | ||||
-rw-r--r-- | asn1/h225/packet-h225-template.h | 22 | ||||
-rw-r--r-- | asn1/h245/h245.cnf | 60 | ||||
-rw-r--r-- | asn1/h245/packet-h245-template.c | 71 | ||||
-rw-r--r-- | asn1/h245/packet-h245-template.h | 6 |
6 files changed, 247 insertions, 61 deletions
diff --git a/asn1/h225/h225.cnf b/asn1/h225/h225.cnf index 0f4d281df6..781fbdf0ff 100644 --- a/asn1/h225/h225.cnf +++ b/asn1/h225/h225.cnf @@ -147,9 +147,9 @@ CallIdentifier/guid guid val_to_str(message_body_val, T_h323_message_body_vals, "<unknown>")); } - if (h225_pi.msg_type == H225_CS) { + if (h225_pi->msg_type == H225_CS) { /* Don't override msg_tag value from IRR */ - h225_pi.msg_tag = message_body_val; + h225_pi->msg_tag = message_body_val; } if (contains_faststart == TRUE ) @@ -167,14 +167,19 @@ CallIdentifier/guid guid #.FN_BODY FastStart/_item guint32 newoffset; guint32 length; + char codec_str[50]; offset=dissect_per_length_determinant(tvb, offset, pinfo, tree, hf_h225_fastStart_item_length, &length); newoffset=offset + (length<<3); /* please note that offset is in bits in PER dissectors, but the item length is in octets */ - offset=dissect_h245_OpenLogicalChannel(tvb,offset, pinfo, tree, hf_index); + offset=dissect_h245_OpenLogicalChannelCodec(tvb,offset, pinfo, tree, hf_index, codec_str); + + /* Add to packet info */ + g_snprintf(h225_pi->frame_label, 50, "%s %s", h225_pi->frame_label, codec_str); + contains_faststart = TRUE; - h225_pi.is_faststart = TRUE; + h225_pi->is_faststart = TRUE; return newoffset; @@ -192,7 +197,7 @@ CallIdentifier/guid guid val_to_str(rasmessage_value, RasMessage_vals, "<unknown>")); } - h225_pi.msg_tag = rasmessage_value; + h225_pi->msg_tag = rasmessage_value; #.END #---------------------------------------------------------------------------------------- # TODO asn2eth can't handle restriced string ? @@ -241,28 +246,85 @@ guint32 value_len; #.END #---------------------------------------------------------------------------------------- +#.FN_FTR NULL + if (h225_pi->cs_type == H225_OTHER) h225_pi->cs_type = H225_EMPTY; +#.END +#---------------------------------------------------------------------------------------- +#.FN_FTR Status-UUIE + /* Add to packet info */ + h225_pi->cs_type = H225_STATUS; + g_snprintf(h225_pi->frame_label, 50, "%s", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>")); +#.END +#---------------------------------------------------------------------------------------- +#.FN_FTR Information-UUIE + /* Add to packet info */ + h225_pi->cs_type = H225_INFORMATION; + g_snprintf(h225_pi->frame_label, 50, "%s", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>")); +#.END +#---------------------------------------------------------------------------------------- +#.FN_FTR Progress-UUIE + /* Add to packet info */ + h225_pi->cs_type = H225_PROGRESS; + if (contains_faststart == TRUE ) + g_snprintf(h225_pi->frame_label, 50, "%s OLC (%s)", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"), h225_pi->frame_label); + else + g_snprintf(h225_pi->frame_label, 50, "%s", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>")); +#.END +#---------------------------------------------------------------------------------------- +#.FN_FTR Facility-UUIE + /* Add to packet info */ + h225_pi->cs_type = H225_FACILITY; + g_snprintf(h225_pi->frame_label, 50, "%s", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>")); +#.END +#---------------------------------------------------------------------------------------- +#.FN_BODY H323-UU-PDU/h245Tunneling + offset=dissect_per_boolean(tvb, offset, pinfo, tree, hf_h225_h245Tunneling, &(h225_pi->is_h245Tunneling), NULL); +#.END +#---------------------------------------------------------------------------------------- #.FN_HDR Setup-UUIE contains_faststart = FALSE; #.END #---------------------------------------------------------------------------------------- #.FN_FTR Setup-UUIE - h225_pi.cs_type = H225_SETUP; + /* Add to packet info */ + h225_pi->cs_type = H225_SETUP; + if (contains_faststart == TRUE ) + g_snprintf(h225_pi->frame_label, 50, "%s OLC (%s)", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"), h225_pi->frame_label); + else + g_snprintf(h225_pi->frame_label, 50, "%s", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>")); #.END #---------------------------------------------------------------------------------------- #.FN_FTR CallProceeding-UUIE - h225_pi.cs_type = H225_CALL_PROCEDING; + /* Add to packet info */ + h225_pi->cs_type = H225_CALL_PROCEDING; + if (contains_faststart == TRUE ) + g_snprintf(h225_pi->frame_label, 50, "%s OLC (%s)", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"), h225_pi->frame_label); + else + g_snprintf(h225_pi->frame_label, 50, "%s", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>")); #.END #---------------------------------------------------------------------------------------- #.FN_FTR Alerting-UUIE - h225_pi.cs_type = H225_ALERTING; + /* Add to packet info */ + h225_pi->cs_type = H225_ALERTING; + if (contains_faststart == TRUE ) + g_snprintf(h225_pi->frame_label, 50, "%s OLC (%s)", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"), h225_pi->frame_label); + else + g_snprintf(h225_pi->frame_label, 50, "%s", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>")); #.END #---------------------------------------------------------------------------------------- #.FN_FTR ReleaseComplete-UUIE - h225_pi.cs_type = H225_RELEASE_COMPLET; + /* Add to packet info */ + h225_pi->cs_type = H225_RELEASE_COMPLET; + g_snprintf(h225_pi->frame_label, 50, "%s", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>")); #.END #---------------------------------------------------------------------------------------- #.FN_FTR Connect-UUIE - h225_pi.cs_type = H225_CONNECT; + /* Add to packet info */ + h225_pi->cs_type = H225_CONNECT; + if (contains_faststart == TRUE ) + g_snprintf(h225_pi->frame_label, 50, "%s OLC (%s)", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"), h225_pi->frame_label); + else + g_snprintf(h225_pi->frame_label, 50, "%s", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>")); #.END #---------------------------------------------------------------------------------------- #.FN_HDR H245TransportAddress @@ -273,9 +335,9 @@ guint32 value_len; #---------------------------------------------------------------------------------------- #.FN_FTR H245TransportAddress /* we need this info for TAPing */ - h225_pi.is_h245 = TRUE; - h225_pi.h245_address = ipv4_address; - h225_pi.h245_port = ipv4_port; + h225_pi->is_h245 = TRUE; + h225_pi->h245_address = ipv4_address; + h225_pi->h245_port = ipv4_port; if((!pinfo->fd->flags.visited) && ipv4_address!=0 && ipv4_port!=0 && h245_handle){ address src_addr; @@ -300,7 +362,7 @@ guint32 value_len; offset = dissect_per_choice(tvb, offset, pinfo, tree, hf_index, ett_h225_FacilityReason, FacilityReason_choice, "FacilityReason", &value); - h225_pi.reason = value; + h225_pi->reason = value; #.END #---------------------------------------------------------------------------------------- @@ -310,7 +372,7 @@ guint32 value_len; offset = dissect_per_choice(tvb, offset, pinfo, tree, hf_index, ett_h225_GatekeeperRejectReason, GatekeeperRejectReason_choice, "GatekeeperRejectReason", &value); - h225_pi.reason = value; + h225_pi->reason = value; #.END #---------------------------------------------------------------------------------------- @@ -320,7 +382,7 @@ guint32 value_len; offset = dissect_per_choice(tvb, offset, pinfo, tree, hf_index, ett_h225_UnregRequestReason, UnregRequestReason_choice, "UnregRequestReason", &value); - h225_pi.reason = value; + h225_pi->reason = value; #.END #---------------------------------------------------------------------------------------- @@ -330,7 +392,7 @@ guint32 value_len; offset = dissect_per_choice(tvb, offset, pinfo, tree, hf_index, ett_h225_UnregRejectReason, UnregRejectReason_choice, "UnregRejectReason", &value); - h225_pi.reason = value; + h225_pi->reason = value; #.END #---------------------------------------------------------------------------------------- #.FN_BODY BandRejectReason @@ -338,7 +400,7 @@ guint32 value_len; offset = dissect_per_choice(tvb, offset, pinfo, tree, hf_index, ett_h225_BandRejectReason, BandRejectReason_choice, "BandRejectReason", &value); - h225_pi.reason = value; + h225_pi->reason = value; #.END #---------------------------------------------------------------------------------------- #.FN_BODY DisengageReason @@ -347,7 +409,7 @@ guint32 value_len; offset = dissect_per_choice(tvb, offset, pinfo, tree, hf_index, ett_h225_DisengageReason, DisengageReason_choice, "DisengageReason", &value); - h225_pi.reason = value; + h225_pi->reason = value; #---------------------------------------------------------------------------------------- #.FN_BODY DisengageRejectReason guint32 value; @@ -355,7 +417,7 @@ guint32 value_len; offset = dissect_per_choice(tvb, offset, pinfo, tree, hf_index, ett_h225_DisengageRejectReason, DisengageRejectReason_choice, "DisengageRejectReason", &value); - h225_pi.reason = value; + h225_pi->reason = value; #.END #---------------------------------------------------------------------------------------- #.FN_BODY AdmissionRejectReason @@ -364,7 +426,7 @@ guint32 value_len; offset = dissect_per_choice(tvb, offset, pinfo, tree, hf_index, ett_h225_AdmissionRejectReason, AdmissionRejectReason_choice, "AdmissionRejectReason", &value); - h225_pi.reason = value; + h225_pi->reason = value; #.END #---------------------------------------------------------------------------------------- #.FN_BODY LocationRejectReason @@ -373,7 +435,7 @@ guint32 value_len; offset = dissect_per_choice(tvb, offset, pinfo, tree, hf_index, ett_h225_LocationRejectReason, LocationRejectReason_choice, "LocationRejectReason", &value); - h225_pi.reason = value; + h225_pi->reason = value; #.END #---------------------------------------------------------------------------------------- #.FN_BODY RegistrationRejectReason @@ -382,7 +444,7 @@ guint32 value_len; offset = dissect_per_choice(tvb, offset, pinfo, tree, hf_index, ett_h225_RegistrationRejectReason, RegistrationRejectReason_choice, "RegistrationRejectReason", &value); - h225_pi.reason = value; + h225_pi->reason = value; #.END #---------------------------------------------------------------------------------------- #.FN_BODY InfoRequestNakReason @@ -391,7 +453,7 @@ guint32 value_len; offset = dissect_per_choice(tvb, offset, pinfo, tree, hf_index, ett_h225_InfoRequestNakReason, InfoRequestNakReason_choice, "InfoRequestNakReason", &value); - h225_pi.reason = value; + h225_pi->reason = value; #.END #---------------------------------------------------------------------------------------- #.FN_BODY ReleaseCompleteReason @@ -400,19 +462,19 @@ guint32 value_len; offset = dissect_per_choice(tvb, offset, pinfo, tree, hf_index, ett_h225_ReleaseCompleteReason, ReleaseCompleteReason_choice, "ReleaseCompleteReason", &value); - h225_pi.reason = value; + h225_pi->reason = value; #.END #---------------------------------------------------------------------------------------- #.FN_BODY CallIdentifier/guid guint32 guid_offset,guid_len; offset = dissect_per_octet_string(tvb,offset,pinfo,tree,hf_index,16,16,&guid_offset,&guid_len); - tvb_memcpy(tvb,h225_pi.guid,guid_offset,guid_len); + tvb_memcpy(tvb,h225_pi->guid,guid_offset,guid_len); #.END #---------------------------------------------------------------------------------------- #.FN_BODY RequestSeqNum offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 1U, 65535U, &(h225_pi.requestSeqNum), NULL, FALSE); + 1U, 65535U, &(h225_pi->requestSeqNum), NULL, FALSE); #---------------------------------------------------------------------------------------- #.FN_BODY H323-UU-PDU/h4501SupplementaryService/_item diff --git a/asn1/h225/packet-h225-template.c b/asn1/h225/packet-h225-template.c index c774f95b5c..0d2ec536e3 100644 --- a/asn1/h225/packet-h225-template.c +++ b/asn1/h225/packet-h225-template.c @@ -67,7 +67,9 @@ static void reset_h225_packet_info(h225_packet_info *pi); static void ras_call_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, h225_packet_info *pi); static int dissect_h225_H323UserInformation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); -static h225_packet_info h225_pi; +static h225_packet_info pi_arr[5]; /* We assuming a maximum of 5 H225 messaages per packet */ +static int pi_current=0; +h225_packet_info *h225_pi=NULL; static dissector_handle_t h225ras_handle; static dissector_handle_t H323UserInformation_handle; @@ -132,9 +134,15 @@ dissect_h225_H323UserInformation(tvbuff_t *tvb, packet_info *pinfo, proto_tree * proto_tree *tr; int offset = 0; + pi_current++; + if(pi_current==5){ + pi_current=0; + } + h225_pi=&pi_arr[pi_current]; + /* Init struct for collecting h225_packet_info */ - reset_h225_packet_info(&(h225_pi)); - h225_pi.msg_type = H225_CS; + reset_h225_packet_info(h225_pi); + h225_pi->msg_type = H225_CS; if (check_col(pinfo->cinfo, COL_PROTOCOL)){ col_set_str(pinfo->cinfo, COL_PROTOCOL, "H.225.0"); @@ -148,7 +156,7 @@ dissect_h225_H323UserInformation(tvbuff_t *tvb, packet_info *pinfo, proto_tree * offset = dissect_h225_H323_UserInformation(tvb, offset,pinfo, tr, hf_h225_H323_UserInformation); - tap_queue_packet(h225_tap, pinfo, &h225_pi); + tap_queue_packet(h225_tap, pinfo, h225_pi); return offset; } @@ -158,9 +166,15 @@ dissect_h225_h225_RasMessage(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree proto_tree *tr; guint32 offset=0; + pi_current++; + if(pi_current==5){ + pi_current=0; + } + h225_pi=&pi_arr[pi_current]; + /* Init struct for collecting h225_packet_info */ - reset_h225_packet_info(&(h225_pi)); - h225_pi.msg_type = H225_RAS; + reset_h225_packet_info(h225_pi); + h225_pi->msg_type = H225_RAS; if (check_col(pinfo->cinfo, COL_PROTOCOL)){ col_set_str(pinfo->cinfo, COL_PROTOCOL, "H.225.0"); @@ -171,12 +185,13 @@ dissect_h225_h225_RasMessage(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree offset = dissect_h225_RasMessage(tvb, 0, pinfo,tr, hf_h225_RasMessage ); - ras_call_matching(tvb, pinfo, tr, &(h225_pi)); + ras_call_matching(tvb, pinfo, tr, h225_pi); - tap_queue_packet(h225_tap, pinfo, &h225_pi); + tap_queue_packet(h225_tap, pinfo, h225_pi); return offset; } + /*--- proto_register_h225 -------------------------------------------*/ void proto_register_h225(void) { @@ -279,8 +294,10 @@ static void reset_h225_packet_info(h225_packet_info *pi) pi->request_available = FALSE; pi->is_faststart = FALSE; pi->is_h245 = FALSE; + pi->is_h245Tunneling = FALSE; pi->h245_address = 0; pi->h245_port = 0; + pi->frame_label[0] = '\0'; } /* diff --git a/asn1/h225/packet-h225-template.h b/asn1/h225/packet-h225-template.h index 604f550be7..69492a3538 100644 --- a/asn1/h225/packet-h225-template.h +++ b/asn1/h225/packet-h225-template.h @@ -33,12 +33,20 @@ typedef enum _h225_msg_type { } h225_msg_type; typedef enum _h225_cs_type { - H225_SETUP, - H225_CALL_PROCEDING, - H225_ALERTING, - H225_CONNECT, - H225_RELEASE_COMPLET, - H225_OTHER + H225_SETUP, + H225_CALL_PROCEDING, + H225_CONNECT, + H225_ALERTING, + H225_INFORMATION, + H225_RELEASE_COMPLET, + H225_FACILITY, + H225_PROGRESS, + H225_EMPTY, + H225_STATUS, + H225_STATUS_INQUIRY, + H225_SETUP_ACK, + H225_NOTIFY, + H225_OTHER } h225_cs_type; typedef struct _h225_packet_info { @@ -54,8 +62,10 @@ typedef struct _h225_packet_info { /* added for h225 conversations analysis */ gboolean is_faststart; /* true, if faststart field is included */ gboolean is_h245; + gboolean is_h245Tunneling; guint32 h245_address; guint16 h245_port; + gchar frame_label[50]; /* the Fram label used by graph_analysis, what is a abreviation of cinfo */ } h225_packet_info; /* diff --git a/asn1/h245/h245.cnf b/asn1/h245/h245.cnf index 1dec2fcc0c..4d0a409a10 100644 --- a/asn1/h245/h245.cnf +++ b/asn1/h245/h245.cnf @@ -33,6 +33,20 @@ OpenLogicalChannel } col_set_fence(pinfo->cinfo,COL_INFO); + + /* Add to packet info */ + + /* if it is TCS*/ + if ((codec_type != NULL) && ( value == 2)) + g_snprintf(h245_pi->frame_label, 50, "%s (%s) ",val_to_str(value, h245_RequestMessage_short_vals, "UKN"), h245_pi->frame_label); + else + g_snprintf(h245_pi->frame_label, 50, "%s ", val_to_str(value, h245_RequestMessage_short_vals, "UKN")); + + g_snprintf(h245_pi->comment, 50, "%s %s ", h245_pi->comment, val_to_str(value, h245_RequestMessage_vals, "<unknown>")); + + /* if it is OLC or RM*/ + if ((codec_type != NULL) && (( value == 3) || ( value == 8))) + g_snprintf(h245_pi->frame_label, 50, "%s (%s) ", h245_pi->frame_label, codec_type); #.END #---------------------------------------------------------------------------------------- #.FN_BODY ResponseMessage @@ -56,6 +70,10 @@ OpenLogicalChannel } col_set_fence(pinfo->cinfo,COL_INFO); + + /* Add to packet info */ + g_snprintf(h245_pi->frame_label, 50, "%s %s ", h245_pi->frame_label, val_to_str(value, h245_ResponseMessage_short_vals, "UKN")); + g_snprintf(h245_pi->comment, 50, "%s %s ", h245_pi->comment, val_to_str(value, h245_ResponseMessage_vals, "<unknown>")); #.END #---------------------------------------------------------------------------------------- #.FN_BODY IndicationMessage @@ -79,6 +97,9 @@ OpenLogicalChannel } col_set_fence(pinfo->cinfo,COL_INFO); + /* Add to packet info */ + g_snprintf(h245_pi->frame_label, 50, "%s %s ", h245_pi->frame_label, val_to_str(value, h245_IndicationMessage_short_vals, "UKN")); + g_snprintf(h245_pi->comment, 50, "%s %s ", h245_pi->comment, val_to_str(value, h245_IndicationMessage_vals, "<unknown>")); #.END #---------------------------------------------------------------------------------------- #.FN_BODY CommandMessage @@ -102,6 +123,10 @@ OpenLogicalChannel } col_set_fence(pinfo->cinfo,COL_INFO); + /* Add to packet info */ + g_snprintf(h245_pi->frame_label, 50, "%s %s ", h245_pi->frame_label, val_to_str(value, h245_CommandMessage_short_vals, "UKN")); + g_snprintf(h245_pi->comment, 50, "%s %s ", h245_pi->comment, val_to_str(value, h245_CommandMessage_vals, "<unknown>")); + #.END #---------------------------------------------------------------------------------------- #.FN_BODY AudioCapability @@ -111,7 +136,9 @@ OpenLogicalChannel ett_h245_AudioCapability, AudioCapability_choice, "AudioCapability", &value); - codec_type = val_to_str(value, h245_AudioCapability_vals, "<unknown>"); + codec_type = val_to_str(value, h245_AudioCapability_short_vals, "<unknown>"); + if (h245_pi != NULL) g_snprintf(h245_pi->frame_label, 50, "%s %s", h245_pi->frame_label, val_to_str(value, h245_AudioCapability_short_vals, "ukn")); + #.END #---------------------------------------------------------------------------------------- #.FN_BODY VideoCapability @@ -122,6 +149,8 @@ OpenLogicalChannel &value); codec_type = val_to_str(value, h245_VideoCapability_vals, "<unknown>"); + if (h245_pi != NULL) g_snprintf(h245_pi->frame_label, 50, "%s %s", h245_pi->frame_label, codec_type); + #.END #---------------------------------------------------------------------------------------- #.FN_BODY Application @@ -132,76 +161,77 @@ OpenLogicalChannel &value); codec_type = val_to_str(value, h245_Application_vals, "<unknown>"); + if (h245_pi != NULL) g_snprintf(h245_pi->frame_label, 50, "%s %s", h245_pi->frame_label, codec_type); #.END #---------------------------------------------------------------------------------------- #.FN_FTR MasterSlaveDeterminationAck - h245_pi.msg_type = H245_MastSlvDetAck; + h245_pi->msg_type = H245_MastSlvDetAck; #.END #---------------------------------------------------------------------------------------- #.FN_FTR MasterSlaveDeterminationReject - h245_pi.msg_type = H245_MastSlvDetRjc; + h245_pi->msg_type = H245_MastSlvDetRjc; #.END #---------------------------------------------------------------------------------------- #.FN_FTR OpenLogicalChannelReject - h245_pi.msg_type = H245_OpenLogChnRjc; + h245_pi->msg_type = H245_OpenLogChnRjc; #.END #---------------------------------------------------------------------------------------- #.FN_FTR CloseLogicalChannel - h245_pi.msg_type = H245_CloseLogChn; + h245_pi->msg_type = H245_CloseLogChn; #.END #---------------------------------------------------------------------------------------- #.FN_FTR CloseLogicalChannelAck - h245_pi.msg_type = H245_CloseLogChnAck; + h245_pi->msg_type = H245_CloseLogChnAck; #.END #---------------------------------------------------------------------------------------- #.FN_FTR OpenLogicalChannelConfirm - h245_pi.msg_type = H245_OpenLogChnCnf; + h245_pi->msg_type = H245_OpenLogChnCnf; #.END #---------------------------------------------------------------------------------------- #.FN_FTR TerminalCapabilitySetAck - h245_pi.msg_type = H245_TermCapSetAck; + h245_pi->msg_type = H245_TermCapSetAck; #.END #---------------------------------------------------------------------------------------- #.FN_FTR MasterSlaveDetermination - h245_pi.msg_type = H245_MastSlvDet; + h245_pi->msg_type = H245_MastSlvDet; #.END #---------------------------------------------------------------------------------------- #.FN_FTR TerminalCapabilitySetReject - h245_pi.msg_type = H245_TermCapSetRjc; + h245_pi->msg_type = H245_TermCapSetRjc; #.END #---------------------------------------------------------------------------------------- #.FN_FTR MasterSlaveDeterminationRelease - h245_pi.msg_type = H245_MastSlvDetRls; + h245_pi->msg_type = H245_MastSlvDetRls; #.END #---------------------------------------------------------------------------------------- #.FN_FTR TerminalCapabilitySet - h245_pi.msg_type = H245_TermCapSet; + h245_pi->msg_type = H245_TermCapSet; #.END #---------------------------------------------------------------------------------------- #.FN_FTR TerminalCapabilitySetRelease - h245_pi.msg_type = H245_TermCapSetRls; + h245_pi->msg_type = H245_TermCapSetRls; #.END #---------------------------------------------------------------------------------------- #.FN_FTR OpenLogicalChannel - h245_pi.msg_type = H245_OpenLogChn; + if (h245_pi != NULL) h245_pi->msg_type = H245_OpenLogChn; #.END #---------------------------------------------------------------------------------------- #.FN_FTR OpenLogicalChannelAck - h245_pi.msg_type = H245_OpenLogChnAck; + h245_pi->msg_type = H245_OpenLogChnAck; #.END #---------------------------------------------------------------------------------------- #.FN_BODY CapabilityIdentifier/standard diff --git a/asn1/h245/packet-h245-template.c b/asn1/h245/packet-h245-template.c index 6766115419..f9cafb8481 100644 --- a/asn1/h245/packet-h245-template.c +++ b/asn1/h245/packet-h245-template.c @@ -70,7 +70,10 @@ static int hf_h245_pdu_type = -1; static int hf_h245Manufacturer = -1; static int h245_tap = -1; static int ett_h245 = -1; -static h245_packet_info h245_pi; +static int h245dg_tap = -1; +static h245_packet_info pi_arr[5]; /* We assuming a maximum of 5 H245 messaages per packet */ +static int pi_current=0; +h245_packet_info *h245_pi=NULL; static gboolean h245_reassembly = TRUE; static gboolean h245_shorttypes = FALSE; @@ -164,6 +167,34 @@ static const value_string h245_CommandMessage_short_vals[] = { { 12, "GC" }, { 0, NULL } }; +static const value_string h245_AudioCapability_short_vals[] = { + { 0, "nonStd" }, + { 1, "g711A" }, + { 2, "g711A56k" }, + { 3, "g711U" }, + { 4, "g711U56k" }, + { 5, "g722-64k" }, + { 6, "g722-56k" }, + { 7, "g722-48k" }, + { 8, "g7231" }, + { 9, "g728" }, + { 10, "g729" }, + { 11, "g729A" }, + { 12, "is11172" }, + { 13, "is13818" }, + { 14, "g729B" }, + { 15, "g729AB" }, + { 16, "g7231C" }, + { 17, "gsmFR" }, + { 18, "gsmHR" }, + { 19, "gsmEFR" }, + { 20, "generic" }, + { 21, "g729Ext" }, + { 22, "vbd" }, + { 23, "audioTelEvent" }, + { 24, "audioTone" }, + { 0, NULL } +}; /* To put the codec type only in COL_INFO when an OLC is read */ @@ -199,12 +230,18 @@ int proto_h245 = -1; void dissect_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - reset_h245_packet_info(&(h245_pi)); - h245_pi.msg_type = H245_OTHER; + pi_current++; + if(pi_current==5){ + pi_current=0; + } + h245_pi=&pi_arr[pi_current]; + + reset_h245_packet_info(h245_pi); + h245_pi->msg_type = H245_OTHER; dissect_tpkt_encap(tvb, pinfo, parent_tree, h245_reassembly, MultimediaSystemControlMessage_handle); - tap_queue_packet(h245_tap, pinfo, &h245_pi); + tap_queue_packet(h245_tap, pinfo, h245_pi); } void @@ -214,6 +251,14 @@ dissect_h245_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) proto_tree *tr; guint32 offset=0; + pi_current++; + if(pi_current==5){ + pi_current=0; + } + h245_pi=&pi_arr[pi_current]; + + reset_h245_packet_info(h245_pi); + h245_pi->msg_type = H245_OTHER; if (check_col(pinfo->cinfo, COL_PROTOCOL)){ col_set_str(pinfo->cinfo, COL_PROTOCOL, "H.245"); @@ -222,8 +267,23 @@ dissect_h245_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) it=proto_tree_add_protocol_format(parent_tree, proto_h245, tvb, 0, tvb_length(tvb), "H.245"); tr=proto_item_add_subtree(it, ett_h245); dissect_h245_MultimediaSystemControlMessage(tvb, offset, pinfo ,tr, hf_h245_pdu_type); + tap_queue_packet(h245dg_tap, pinfo, h245_pi); } +int +dissect_h245_OpenLogicalChannelCodec(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index, char *codec_str) { + offset = dissect_per_sequence(tvb, offset, pinfo, tree, hf_index, + ett_h245_OpenLogicalChannel, OpenLogicalChannel_sequence); + + + if (h245_pi != NULL) h245_pi->msg_type = H245_OpenLogChn; + + if (codec_str){ + g_strlcpy(codec_str, codec_type, 50); + } + + return offset; +} /*--- proto_register_h245 -------------------------------------------*/ void proto_register_h245(void) { @@ -270,6 +330,7 @@ void proto_register_h245(void) { nsp_object_dissector_table = register_dissector_table("h245.nsp.object", "H.245 NonStandardParameter (object)", FT_STRING, BASE_NONE); nsp_h221_dissector_table = register_dissector_table("h245.nsp.h221", "H.245 NonStandardParameter (h221)", FT_UINT32, BASE_HEX); h245_tap = register_tap("h245"); + h245dg_tap = register_tap("h245dg"); register_ber_oid_name("0.0.8.239.1.1","itu-t(0) recommendation(0) h(8) h239(239) generic-capabilities(1) h239ControlCapability(1)"); register_ber_oid_name("0.0.8.239.1.2","itu-t(0) recommendation(0) h(8) h239(239) generic-capabilities(1) h239ExtendedVideoCapability(2)"); @@ -309,5 +370,7 @@ static void reset_h245_packet_info(h245_packet_info *pi) } pi->msg_type = H245_OTHER; + pi->frame_label[0] = '\0'; + sprintf(pi->comment, "H245 "); } diff --git a/asn1/h245/packet-h245-template.h b/asn1/h245/packet-h245-template.h index 3dff3f9132..598378ff91 100644 --- a/asn1/h245/packet-h245-template.h +++ b/asn1/h245/packet-h245-template.h @@ -2,7 +2,7 @@ * Routines for h245 packet dissection * Copyright 2005, Anders Broman <anders.broman@ericsson.com> * - * $Id: packet-h245-template.h 12203 2004-10-05 09:18:55Z guy $ + * $Id$ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -45,10 +45,14 @@ typedef enum _h245_msg_type { typedef struct _h245_packet_info { h245_msg_type msg_type; /* type of message */ + gchar frame_label[50]; /* the Frame label used by graph_analysis, what is a abreviation of cinfo */ + gchar comment[50]; /* the Frame Comment used by graph_analysis, what is a message desc */ } h245_packet_info; #include "packet-h245-exp.h"*/ +int dissect_h245_OpenLogicalChannelCodec(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index, char *codec_str); + #endif /* PACKET_H245_H */ |