2 * Routines for H.460.x packet dissection
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #include <epan/packet.h>
32 #include <epan/conversation.h>
33 #include <epan/oids.h>
34 #include <epan/asn1.h>
39 #include "packet-per.h"
40 #include "packet-h225.h"
41 #include "packet-h235.h"
42 #include "packet-h245.h"
44 #define PNAME "H.460 Supplementary Services"
45 #define PSNAME "H.460"
48 /* Initialize the protocol and registered fields */
50 #include "packet-h460-hf.c"
52 /* Initialize the subtree pointers */
53 #include "packet-h460-ett.c"
56 static dissector_handle_t q931_ie_handle = NULL;
57 static dissector_handle_t h225_ras_handle = NULL;
59 #include "packet-h460-fn.c"
62 dissect_ies(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
66 call_dissector(q931_ie_handle, tvb, pinfo, tree);
67 offset += tvb_length_remaining(tvb, offset);
73 dissect_ras(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
76 if (h225_ras_handle) {
77 call_dissector(h225_ras_handle, tvb, pinfo, tree);
78 offset += tvb_length_remaining(tvb, offset);
83 typedef struct _h460_feature_t {
87 new_dissector_t content_pdu;
93 dissector_handle_t content_hnd;
96 /* Fill in the items after content_pdu */
97 #define FFILL NULL, NULL, NULL, NULL, NULL
100 #define GD 0x01 /* present in H.225 GenericData */
101 #define FD 0x02 /* present in H.225 FeatureDescriptor */
102 #define GM 0x04 /* present in H.245 GenericMessage */
103 #define GI 0x08 /* present in H.245 GenericInformation */
105 static h460_feature_t h460_feature_tab[] = {
107 { GD|FD, "2", "Number Portability", NULL, FFILL },
108 { GD|FD, "2/1", "NumberPortabilityData", dissect_h460_2_NumberPortabilityInfo_PDU, FFILL },
110 { GD|FD, "3", "Circuit Status", NULL, FFILL },
111 { GD|FD, "3/1", "Circuit Status Map", dissect_h460_3_CircuitStatus_PDU, FFILL },
113 { GD|FD, "4", "CallPriorityDesignation", NULL, FFILL },
114 { GD|FD, "4/1", "CallPriorityRequest", dissect_h460_4_CallPriorityInfo_PDU, FFILL },
115 { GD|FD, "4/2", "CallPriorityConfirm", dissect_h460_4_CallPriorityInfo_PDU, FFILL },
116 { GD|FD, "4/3", "Country/InternationalNetworkCallOriginationRequest", dissect_h460_4_CountryInternationalNetworkCallOriginationIdentification_PDU, FFILL },
117 { GD|FD, "4/4", "Country/InternationalNetworkCallOriginationConfirm", dissect_h460_4_CountryInternationalNetworkCallOriginationIdentification_PDU, FFILL },
119 { GD|FD, "5", "DuplicateIEs", NULL, FFILL },
120 { GD|FD, "5/1", "IEsString", dissect_ies, FFILL },
122 { GD|FD, "6", "Extended Fast Connect", NULL, FFILL },
123 { GD|FD, "6/1", "EFC Proposal", NULL, FFILL },
124 { GD|FD, "6/2", "EFC Close All Media Channels", NULL, FFILL },
125 { GD|FD, "6/3", "EFC Request New Proposals", NULL, FFILL },
126 { GD|FD, "6/4", "EFC Require Symmetric Operation", NULL, FFILL },
128 { GD|FD, "7", "Digit Maps", NULL, FFILL },
129 { FD, "7/1", "Digit Maps Length", NULL, FFILL },
130 { FD, "7/2", "Digit Map Length for Overlapped Sending", NULL, FFILL },
131 { FD, "7/3", "HTTP Digit Maps Download Capability", NULL, FFILL },
132 { GD , "7/1", "Start Timer", NULL, FFILL },
133 { GD , "7/2", "Short Timer", NULL, FFILL },
134 { GD , "7/3", "Long Timer", NULL, FFILL },
135 { GD , "7/4", "Digit Map String", NULL, FFILL },
136 { GD , "7/5", "ToN Associated Digit Map", NULL, FFILL },
137 { GD , "7/5/1", "Type of Number", NULL, FFILL },
138 { GD , "7/5/2", "Digit Map Strings for ToN", NULL, FFILL },
139 { GD , "7/6", "Digit Map URL", NULL, FFILL },
141 { GD|FD, "8", "Querying for Alternate Routes", NULL, FFILL },
142 { GD|FD, "8/1", "Query Count", NULL, FFILL },
143 { GD|FD, "8/2", "Call Termination Cause", NULL, FFILL },
145 { GD|FD, "9", "QoS-monitoring Reporting", NULL, FFILL },
146 { GD|FD, "9/1", "qosMonitoringFinalOnly", NULL, FFILL },
147 { GD|FD, "9/2", "qosMonitoringReportData", dissect_h460_9_QosMonitoringReportData_PDU, FFILL },
148 { GD|FD, "9/3", "qosMonitoringExtendedRTPMetrics", dissect_h460_9_ExtendedRTPMetrics_PDU, FFILL },
150 { GD|FD, "10", "Call Party Category", NULL, FFILL },
151 { GD|FD, "10/1", "Call party category info", dissect_h460_10_CallPartyCategoryInfo_PDU, FFILL },
153 { GD|FD, "11", "Delayed Call Establishment", NULL, FFILL },
154 { GD|FD, "11/1", "Delay Point Indicator", NULL, FFILL },
155 { GD|FD, "11/2", "Implicit DCE Release", NULL, FFILL },
156 { GD|FD, "11/3", "Delay Point Reached", NULL, FFILL },
157 { GD|FD, "11/4", "DCE Release", NULL, FFILL },
159 { GD|FD, "12", "Glare Control Indicator", NULL, FFILL },
160 { GD|FD, "12/1", "Glare Control Indicator Parameter", NULL, FFILL },
162 { GD|FD, "13", "Called User Release Control", NULL, FFILL },
163 { GD|FD, "13/1", "Called User Release Control", NULL, FFILL },
165 { GD|FD, "14", "Multi-Level Precedence and Preemption", NULL, FFILL },
166 { GD|FD, "14/1", "MLPP Information", dissect_h460_14_MLPPInfo_PDU, FFILL },
168 { GD|FD, "15", "Call signalling transport channel suspension and redirection", NULL, FFILL },
169 { GD|FD, "15/1", "Signalling channel suspend and redirect", dissect_h460_15_SignallingChannelData_PDU, FFILL },
171 { GD|FD, "16", "Multiple-message Release Sequence", NULL, FFILL },
172 { GD|FD, "16/1", "MMRS use required", NULL, FFILL },
173 { GD|FD, "16/2", "MMRS procedure", NULL, FFILL },
174 { GD|FD, "16/3", "MMRS additional IEs", dissect_ies, FFILL },
176 { GD|FD, "17", "RAS over H.225.0", NULL, FFILL },
177 { GD|FD, "17/1", "RAS message", dissect_ras, FFILL },
179 { GD|FD|GM, "18", "Signalling Traversal", NULL, FFILL },
180 { GD|FD , "18/1", "IncomingCallIndication", dissect_h460_18_IncomingCallIndication_PDU, FFILL },
181 { GD|FD , "18/2", "LRQKeepAliveData", dissect_h460_18_LRQKeepAliveData_PDU, FFILL },
182 { GM, "18-1", "connectionCorrelation", NULL, FFILL },
183 { GM, "18-1/1", "callIdentifier", NULL, FFILL },
184 { GM, "18-1/2", "answerCall", NULL, FFILL },
186 { GD|FD|GI, "19", "mediaNATFWTraversal", NULL, FFILL },
187 { GD|FD , "19/1", "supportTransmitMultiplexedMedia", NULL, FFILL },
188 { GD|FD , "19/2", "mediaTraversalServer", NULL, FFILL },
189 { GI, "19/1", "Traversal Parameters", dissect_h460_19_TraversalParameters_PDU, FFILL },
191 { GD|FD, "20", "LocationSourceAddress", NULL, FFILL },
192 { GD|FD, "20/1", "LocationSourceAddress", dissect_h225_ExtendedAliasAddress_PDU, FFILL },
194 { GD|FD, "21", "Message Broadcast", NULL, FFILL },
195 { GD|FD, "21/1", "MessageBroadcastParameter", dissect_h460_21_CapabilityAdvertisement_PDU, FFILL },
197 { GD|FD, "22", "securityProtocolNegotiation", NULL, FFILL },
198 { GD|FD, "22/1", "tlsSecurityProtocol", NULL, FFILL },
199 { GD|FD, "22/1/1", "priority", NULL, FFILL },
200 { GD|FD, "22/1/2", "connectionAddress", NULL, FFILL },
201 { GD|FD, "22/2", "ipsecSecurityProtocol", NULL, FFILL },
202 { GD|FD, "22/2/1", "priority", NULL, FFILL },
203 { 0, NULL, NULL, NULL, FFILL },
206 static h460_feature_t *find_ftr(const gchar *key) {
207 h460_feature_t *ftr = NULL;
210 for (f=h460_feature_tab; f->id; f++) {
211 if (f->key_gd && !strcmp(key, f->key_gd)) { ftr = f; break; }
212 if (f->key_fd && !strcmp(key, f->key_fd)) { ftr = f; break; }
213 if (f->key_gm && !strcmp(key, f->key_gm)) { ftr = f; break; }
214 if (f->key_gi && !strcmp(key, f->key_gi)) { ftr = f; break; }
219 /*--- dissect_h460_name -------------------------------------------*/
221 dissect_h460_name(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree) {
226 actx = get_asn1_ctx(pinfo->private_data);
227 DISSECTOR_ASSERT(actx);
229 /* DEBUG */ /*proto_tree_add_text(tree, tvb, 0, 0, "*** DEBUG dissect_h460_name: %s", pinfo->match_string);*/
230 ftr = find_ftr(pinfo->match_string);
231 /* DEBUG */ /*proto_tree_add_text(tree, tvb, 0, 0, "*** DEBUG dissect_h460_name: ftr %s", (ftr)?ftr->name:"-none-");*/
233 proto_item_append_text(actx->created_item, " - %s", ftr->name);
234 proto_item_append_text(proto_item_get_parent(proto_tree_get_parent(tree)), ": %s", ftr->name);
236 proto_item_append_text(actx->created_item, " - unknown(%s)", pinfo->match_string);
243 /*--- proto_register_h460 ----------------------------------------------*/
244 void proto_register_h460(void) {
248 static hf_register_info hf[] = {
249 #include "packet-h460-hfarr.c"
252 /* List of subtrees */
253 static gint *ett[] = {
254 #include "packet-h460-ettarr.c"
257 /* Register protocol */
258 proto_h460 = proto_register_protocol(PNAME, PSNAME, PFNAME);
260 /* Register fields and subtrees */
261 proto_register_field_array(proto_h460, hf, array_length(hf));
262 proto_register_subtree_array(ett, array_length(ett));
264 for (ftr=h460_feature_tab; ftr->id; ftr++) {
265 if (ftr->opt & GD) ftr->key_gd = g_strdup_printf("GenericData/%s", ftr->id);
266 if (ftr->opt & FD) ftr->key_fd = g_strdup_printf("FeatureDescriptor/%s", ftr->id);
267 if (ftr->opt & GM) ftr->key_gm = g_strdup_printf("GenericMessage/%s", ftr->id);
268 if (ftr->opt & GI) ftr->key_gi = g_strdup_printf("GenericInformation/%s", ftr->id);
269 if (ftr->content_pdu) ftr->content_hnd = new_create_dissector_handle(ftr->content_pdu, proto_h460);
273 /*--- proto_reg_handoff_h460 -------------------------------------------*/
274 void proto_reg_handoff_h460(void)
277 dissector_handle_t h460_name_handle;
279 q931_ie_handle = find_dissector("q931.ie");
280 h225_ras_handle = find_dissector("h225.ras");
282 h460_name_handle = new_create_dissector_handle(dissect_h460_name, proto_h460);
283 for (ftr=h460_feature_tab; ftr->id; ftr++) {
284 if (ftr->key_gd) dissector_add_string("h225.gef.name", ftr->key_gd, h460_name_handle);
285 if (ftr->key_fd) dissector_add_string("h225.gef.name", ftr->key_fd, h460_name_handle);
286 if (ftr->key_gm) dissector_add_string("h245.gef.name", ftr->key_gm, h460_name_handle);
287 if (ftr->key_gi) dissector_add_string("h245.gef.name", ftr->key_gi, h460_name_handle);
288 if (ftr->content_hnd) {
289 if (ftr->key_gd) dissector_add_string("h225.gef.content", ftr->key_gd, ftr->content_hnd);
290 if (ftr->key_fd) dissector_add_string("h225.gef.content", ftr->key_fd, ftr->content_hnd);
291 if (ftr->key_gm) dissector_add_string("h245.gef.content", ftr->key_gm, ftr->content_hnd);
292 if (ftr->key_gi) dissector_add_string("h245.gef.content", ftr->key_gi, ftr->content_hnd);