HACK: pinfo->private_data points to smb_info again
[wireshark-wip.git] / asn1 / h245 / packet-h245-template.c
blobe791a4f0075a4a0859af382424a0abae8082242f
1 /* packet-h245_asn1.c
2 * Routines for h245 packet dissection
3 * Copyright 2004, Anders Broman <anders.broman@ericsson.com>
5 * $Id$
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 * To quote the author of the previous H245 dissector:
26 * "This is a complete replacement of the previous limitied dissector
27 * that Ronnie was crazy enough to write by hand. It was a lot of time
28 * to hack it by hand, but it is incomplete and buggy and it is good when
29 * it will go away."
30 * Ronnie did a great job and all the VoIP users had made good use of it!
31 * Credit to Tomas Kukosa for developing the asn2wrs compiler.
35 #include "config.h"
37 #include <glib.h>
38 #include <epan/packet.h>
39 #include <epan/exceptions.h>
40 #include <epan/strutil.h>
41 #include <wsutil/pint.h>
43 #include <string.h>
45 #include <epan/prefs.h>
46 #include <epan/t35.h>
47 #include <epan/wmem/wmem.h>
48 #include <epan/oids.h>
49 #include <epan/asn1.h>
50 #include <epan/tap.h>
51 #include "packet-tpkt.h"
52 #include "packet-per.h"
53 #include "packet-h323.h"
54 #include "packet-h245.h"
55 #include "packet-rtp.h"
56 #include "packet-rtcp.h"
57 #include "packet-t38.h"
59 #define PNAME "MULTIMEDIA-SYSTEM-CONTROL"
60 #define PSNAME "H.245"
61 #define PFNAME "h245"
64 static dissector_handle_t rtcp_handle=NULL;
65 static dissector_table_t nsp_object_dissector_table;
66 static dissector_table_t nsp_h221_dissector_table;
67 static dissector_table_t gef_name_dissector_table;
68 static dissector_table_t gef_content_dissector_table;
69 static dissector_handle_t nsp_handle;
70 static dissector_handle_t data_handle;
71 static dissector_handle_t MultimediaSystemControlMessage_handle;
72 static dissector_handle_t h263_handle = NULL;
73 static dissector_handle_t amr_handle = NULL;
75 static void init_h245_packet_info(h245_packet_info *pi);
76 static int hf_h245_pdu_type = -1;
77 static int hf_h245Manufacturer = -1;
78 static int hf_h245_subMessageIdentifier_standard = -1;
79 static int h245_tap = -1;
80 static int h245dg_tap = -1;
81 h245_packet_info *h245_pi=NULL;
83 static gboolean h245_reassembly = TRUE;
84 static gboolean h245_shorttypes = FALSE;
86 #include "packet-h245-val.h"
88 static const value_string h245_RequestMessage_short_vals[] = {
89 { RequestMessage_nonStandard , "NSM" },
90 { RequestMessage_masterSlaveDetermination , "MSD" },
91 { RequestMessage_terminalCapabilitySet , "TCS" },
92 { RequestMessage_openLogicalChannel , "OLC" },
93 { RequestMessage_closeLogicalChannel , "CLC" },
94 { RequestMessage_requestChannelClose , "RCC" },
95 { RequestMessage_multiplexEntrySend , "MES" },
96 { RequestMessage_requestMultiplexEntry , "RME" },
97 { RequestMessage_requestMode , "RM" },
98 { RequestMessage_roundTripDelayRequest , "RTDR" },
99 { RequestMessage_maintenanceLoopRequest , "MLR" },
100 { RequestMessage_communicationModeRequest , "CMR" },
101 { RequestMessage_conferenceRequest , "CR" },
102 { RequestMessage_multilinkRequest , "MR" },
103 { RequestMessage_logicalChannelRateRequest, "LCRR" },
104 { RequestMessage_genericRequest , "GR" },
105 { 0, NULL }
107 static const value_string h245_ResponseMessage_short_vals[] = {
108 { ResponseMessage_nonStandard , "NSM" },
109 { ResponseMessage_masterSlaveDeterminationAck , "MSDAck" },
110 { ResponseMessage_masterSlaveDeterminationReject, "MSDReject" },
111 { ResponseMessage_terminalCapabilitySetAck , "TCSAck" },
112 { ResponseMessage_terminalCapabilitySetReject , "TCSReject" },
113 { ResponseMessage_openLogicalChannelAck , "OLCAck" },
114 { ResponseMessage_openLogicalChannelReject , "OLCReject" },
115 { ResponseMessage_closeLogicalChannelAck , "CLCAck" },
116 { ResponseMessage_requestChannelCloseAck , "RCCAck" },
117 { ResponseMessage_requestChannelCloseReject , "RCCReject" },
118 { ResponseMessage_multiplexEntrySendAck , "MESAck" },
119 { ResponseMessage_multiplexEntrySendReject , "MESReject" },
120 { ResponseMessage_requestMultiplexEntryAck , "RMEAck" },
121 { ResponseMessage_requestMultiplexEntryReject , "RMEReject" },
122 { ResponseMessage_requestModeAck , "RMAck" },
123 { ResponseMessage_requestModeReject , "RMReject" },
124 { ResponseMessage_roundTripDelayResponse , "RTDResponse" },
125 { ResponseMessage_maintenanceLoopAck , "MLAck" },
126 { ResponseMessage_maintenanceLoopReject , "MLReject" },
127 { ResponseMessage_communicationModeResponse , "CMResponse" },
128 { ResponseMessage_conferenceResponse , "CResponse" },
129 { ResponseMessage_multilinkResponse , "MResponse" },
130 { ResponseMessage_logicalChannelRateAcknowledge , "LCRAck" },
131 { ResponseMessage_logicalChannelRateReject , "LCRReject" },
132 { ResponseMessage_genericResponse , "GR" },
133 { 0, NULL }
135 static const value_string h245_IndicationMessage_short_vals[] = {
136 { IndicationMessage_nonStandard , "NSM" },
137 { IndicationMessage_functionNotUnderstood , "FNU" },
138 { IndicationMessage_masterSlaveDeterminationRelease , "MSDRelease" },
139 { IndicationMessage_terminalCapabilitySetRelease , "TCSRelease" },
140 { IndicationMessage_openLogicalChannelConfirm , "OLCConfirm" },
141 { IndicationMessage_requestChannelCloseRelease , "RCCRelease" },
142 { IndicationMessage_multiplexEntrySendRelease , "MESRelease" },
143 { IndicationMessage_requestMultiplexEntryRelease , "RMERelease" },
144 { IndicationMessage_requestModeRelease , "RMRelease" },
145 { IndicationMessage_miscellaneousIndication , "MI" },
146 { IndicationMessage_jitterIndication , "JI" },
147 { IndicationMessage_h223SkewIndication , "H223SI" },
148 { IndicationMessage_newATMVCIndication , "NATMVCI" },
149 { IndicationMessage_userInput , "UII" },
150 { IndicationMessage_h2250MaximumSkewIndication , "H2250MSI" },
151 { IndicationMessage_mcLocationIndication , "MCLI" },
152 { IndicationMessage_conferenceIndication , "CI" },
153 { IndicationMessage_vendorIdentification , "VI" },
154 { IndicationMessage_functionNotSupported , "FNS" },
155 { IndicationMessage_multilinkIndication , "MultilinkIndication" },
156 { IndicationMessage_logicalChannelRateRelease , "LCRRelease" },
157 { IndicationMessage_flowControlIndication , "FCIndication" },
158 { IndicationMessage_mobileMultilinkReconfigurationIndication, "MMRI" },
159 { IndicationMessage_genericIndication , "GI" },
160 { 0, NULL }
162 static const value_string h245_CommandMessage_short_vals[] = {
163 { CommandMessage_nonStandard , "NSM" },
164 { CommandMessage_maintenanceLoopOffCommand , "MLOC" },
165 { CommandMessage_sendTerminalCapabilitySet , "STCS" },
166 { CommandMessage_encryptionCommand , "EC" },
167 { CommandMessage_flowControlCommand , "FCC" },
168 { CommandMessage_endSessionCommand , "ESC" },
169 { CommandMessage_miscellaneousCommand , "MC" },
170 { CommandMessage_communicationModeCommand , "CMC" },
171 { CommandMessage_conferenceCommand , "CC" },
172 { CommandMessage_h223MultiplexReconfiguration , "H223MR" },
173 { CommandMessage_newATMVCCommand , "NATMVCC" },
174 { CommandMessage_mobileMultilinkReconfigurationCommand, "MMRC" },
175 { CommandMessage_genericCommand , "GC" },
176 { 0, NULL }
179 static const value_string h245_AudioCapability_short_vals[] = {
180 { AudioCapability_nonStandard , "nonStd" },
181 { AudioCapability_g711Alaw64k , "g711A" },
182 { AudioCapability_g711Alaw56k , "g711A56k" },
183 { AudioCapability_g711Ulaw64k , "g711U" },
184 { AudioCapability_g711Ulaw56k , "g711U56k" },
185 { AudioCapability_g722_64k , "g722-64k" },
186 { AudioCapability_g722_56k , "g722-56k" },
187 { AudioCapability_g722_48k , "g722-48k" },
188 { AudioCapability_g7231 , "g7231" },
189 { AudioCapability_g728 , "g728" },
190 { AudioCapability_g729 , "g729" },
191 { AudioCapability_g729AnnexA , "g729A" },
192 { AudioCapability_is11172AudioCapability, "is11172" },
193 { AudioCapability_is13818AudioCapability, "is13818" },
194 { AudioCapability_g729wAnnexB , "g729B" },
195 { AudioCapability_g729AnnexAwAnnexB , "g729AB" },
196 { AudioCapability_g7231AnnexCCapability , "g7231C" },
197 { AudioCapability_gsmFullRate , "gsmFR" },
198 { AudioCapability_gsmHalfRate , "gsmHR" },
199 { AudioCapability_gsmEnhancedFullRate , "gsmEFR" },
200 { AudioCapability_genericAudioCapability, "generic" },
201 { AudioCapability_g729Extensions , "g729Ext" },
202 { AudioCapability_vbd , "vbd" },
203 { AudioCapability_audioTelephonyEvent , "audioTelEvent" },
204 { AudioCapability_audioTone , "audioTone" },
205 { 0, NULL }
208 /* To put the codec type only in COL_INFO when
209 an OLC is read */
210 const char* codec_type = NULL;
211 static guint32 rfc_number;
213 typedef struct _unicast_addr_t {
214 address addr;
215 guint8 addr_buf[16];
216 guint32 port;
217 } unicast_addr_t;
219 typedef struct _channel_info_t {
220 gchar data_type_str[32];
221 unicast_addr_t *upcoming_addr;
222 unicast_addr_t media_addr;
223 unicast_addr_t media_control_addr;
224 unsigned int rfc2198;
225 gboolean srtp_flag;
226 gboolean is_video;
227 } channel_info_t;
229 typedef struct _olc_info_t {
230 guint16 fwd_lc_num;
231 channel_info_t fwd_lc;
232 channel_info_t rev_lc;
233 } olc_info_t;
235 static GHashTable* h245_pending_olc_reqs = NULL;
236 static gboolean fast_start = FALSE;
237 static olc_info_t *upcoming_olc = NULL;
238 static channel_info_t *upcoming_channel = NULL;
240 /* NonStandardParameter */
241 static const char *nsiOID;
242 static guint32 h221NonStandard;
243 static guint32 t35CountryCode;
244 static guint32 t35Extension;
245 static guint32 manufacturerCode;
247 static const value_string h245_RFC_number_vals[] = {
248 { 2190, "RFC 2190 - H.263 Video Streams" },
249 { 2198, "RFC 2198 - RTP Payload for Redundant Audio Data" },
250 { 2429, "RFC 2429 - 1998 Version of ITU-T Rec. H.263 Video (H.263+)" },
251 { 3016, "RFC 3016 - RTP Payload Format for MPEG-4 Audio/Visual Streams" },
252 { 3267, "RFC 3267 - Adaptive Multi-Rate (AMR) and Adaptive Multi-Rate Wideband (AMR-WB)" },
253 { 3984, "RFC 3984 - RTP Payload Format for H.264 Video" },
254 { 0, NULL }
257 /* Table 7/H.239 subMessageIdentifier values */
258 static const value_string h245_h239subMessageIdentifier_vals[] = {
259 { 1, "flowControlReleaseRequest" },
260 { 2, "flowControlReleaseResponse" },
261 { 3, "presentationTokenRequest" },
262 { 4, "presentationTokenResponse" },
263 { 5, "presentationTokenRelease" },
264 { 6, "presentationTokenIndicateOwner" },
265 { 0, NULL }
269 /* h223 multiplex codes */
270 static h223_set_mc_handle_t h223_set_mc_handle = NULL;
271 h223_mux_element *h223_me=NULL;
272 guint8 h223_mc=0;
273 void h245_set_h223_set_mc_handle( h223_set_mc_handle_t handle )
275 h223_set_mc_handle = handle;
278 /* h223 logical channels */
279 typedef struct {
280 h223_lc_params *fw_channel_params;
281 h223_lc_params *rev_channel_params;
282 } h223_pending_olc;
284 static GHashTable* h223_pending_olc_reqs[] = { NULL, NULL };
285 static dissector_handle_t h245_lc_dissector;
286 static guint16 h245_lc_temp;
287 static guint16 h223_fw_lc_num;
288 static guint16 h223_rev_lc_num;
289 static h223_lc_params *h223_lc_params_temp;
290 static h223_lc_params *h223_fw_lc_params;
291 static h223_lc_params *h223_rev_lc_params;
292 static h223_add_lc_handle_t h223_add_lc_handle = NULL;
294 static void h223_lc_init_dir( int dir )
296 if ( h223_pending_olc_reqs[dir] )
297 g_hash_table_destroy( h223_pending_olc_reqs[dir] );
298 h223_pending_olc_reqs[dir] = g_hash_table_new( g_direct_hash, g_direct_equal );
301 static void h223_lc_init( void )
303 h223_lc_init_dir( P2P_DIR_SENT );
304 h223_lc_init_dir( P2P_DIR_RECV );
305 h223_lc_params_temp = NULL;
306 h245_lc_dissector = NULL;
307 h223_fw_lc_num = 0;
310 static void h245_init(void)
312 if ( h245_pending_olc_reqs)
313 g_hash_table_destroy(h245_pending_olc_reqs);
314 h245_pending_olc_reqs = g_hash_table_new(g_str_hash, g_str_equal);
316 h223_lc_init();
319 void h245_set_h223_add_lc_handle( h223_add_lc_handle_t handle )
321 h223_add_lc_handle = handle;
324 static const gchar *gen_olc_key(guint16 lc_num, address *dst_addr, address *src_addr)
326 return wmem_strdup_printf(wmem_packet_scope(), "%s/%s/%u", ep_address_to_str(dst_addr), ep_address_to_str(src_addr), lc_num);
329 static void update_unicast_addr(unicast_addr_t *req_addr, unicast_addr_t *ack_addr)
331 if (ack_addr->addr.type!=AT_NONE && ack_addr->port!=0) {
332 memcpy(req_addr->addr_buf, ack_addr->addr_buf, sizeof(req_addr->addr_buf));
333 SET_ADDRESS(&req_addr->addr, ack_addr->addr.type, ack_addr->addr.len, req_addr->addr_buf);
334 req_addr->port = ack_addr->port;
338 static void h245_setup_channels(packet_info *pinfo, channel_info_t *upcoming_channel_lcl)
340 gint *key;
341 GHashTable *rtp_dyn_payload = NULL;
342 struct srtp_info *dummy_srtp_info = NULL;
344 if (!upcoming_channel_lcl) return;
346 /* T.38 */
347 if (!strcmp(upcoming_channel_lcl->data_type_str, "t38fax")) {
348 if (upcoming_channel_lcl->media_addr.addr.type!=AT_NONE && upcoming_channel_lcl->media_addr.port!=0) {
349 t38_add_address(pinfo, &upcoming_channel_lcl->media_addr.addr,
350 upcoming_channel_lcl->media_addr.port, 0,
351 "H245", pinfo->fd->num);
353 return;
356 /* (S)RTP, (S)RTCP */
357 if (upcoming_channel_lcl->rfc2198 > 0) {
358 encoding_name_and_rate_t *encoding_name_and_rate = wmem_new(wmem_file_scope(), encoding_name_and_rate_t);
359 rtp_dyn_payload = g_hash_table_new(g_int_hash, g_int_equal);
360 encoding_name_and_rate->encoding_name = wmem_strdup(wmem_file_scope(), "red");
361 encoding_name_and_rate->sample_rate = 8000;
362 key = wmem_new(wmem_file_scope(), gint);
363 *key = upcoming_channel_lcl->rfc2198;
364 g_hash_table_insert(rtp_dyn_payload, key, encoding_name_and_rate);
367 if (upcoming_channel_lcl->srtp_flag) {
368 dummy_srtp_info = wmem_new0(wmem_file_scope(), struct srtp_info);
371 /* DEBUG g_warning("h245_setup_channels media_addr.addr.type %u port %u",upcoming_channel_lcl->media_addr.addr.type, upcoming_channel_lcl->media_addr.port );
373 if (upcoming_channel_lcl->media_addr.addr.type!=AT_NONE && upcoming_channel_lcl->media_addr.port!=0) {
374 srtp_add_address(pinfo, &upcoming_channel_lcl->media_addr.addr,
375 upcoming_channel_lcl->media_addr.port, 0,
376 "H245", pinfo->fd->num, upcoming_channel_lcl->is_video , rtp_dyn_payload, dummy_srtp_info);
378 if (upcoming_channel_lcl->media_control_addr.addr.type!=AT_NONE && upcoming_channel_lcl->media_control_addr.port!=0 && rtcp_handle) {
379 srtcp_add_address(pinfo, &upcoming_channel_lcl->media_control_addr.addr,
380 upcoming_channel_lcl->media_control_addr.port, 0,
381 "H245", pinfo->fd->num, dummy_srtp_info);
385 /* Initialize the protocol and registered fields */
386 static int proto_h245 = -1;
387 #include "packet-h245-hf.c"
389 /* Initialize the subtree pointers */
390 static int ett_h245 = -1;
391 static int ett_h245_returnedFunction = -1;
392 #include "packet-h245-ett.c"
394 /* Forward declarations */
395 static int dissect_h245_MultimediaSystemControlMessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
396 static void reset_h245_pi(void *dummy _U_)
398 h245_pi = NULL; /* Make sure we don't leave ep_alloc()ated memory lying around */
401 #include "packet-h245-fn.c"
403 static void
404 dissect_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
407 * MultimediaSystemControlMessage_handle is the handle for
408 * dissect_h245_h245, so we don't want to do any h245_pi or tap stuff here.
410 dissect_tpkt_encap(tvb, pinfo, parent_tree, h245_reassembly, MultimediaSystemControlMessage_handle);
414 static void
415 dissect_h245_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
417 proto_item *it;
418 proto_tree *tr;
419 guint32 offset=0;
420 asn1_ctx_t asn1_ctx;
422 fast_start = FALSE;
423 /* Clean up from any previous packet dissection */
424 upcoming_olc = NULL;
425 upcoming_channel = NULL;
426 codec_type = NULL;
428 col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME);
430 it=proto_tree_add_protocol_format(parent_tree, proto_h245, tvb, 0, tvb_length(tvb), PSNAME);
431 tr=proto_item_add_subtree(it, ett_h245);
433 /* assume that whilst there is more tvb data, there are more h245 commands */
434 while ( tvb_length_remaining( tvb, offset>>3 )>0 ){
435 CLEANUP_PUSH(reset_h245_pi, NULL);
436 h245_pi=wmem_new(wmem_packet_scope(), h245_packet_info);
437 init_h245_packet_info(h245_pi);
438 asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo);
439 offset = dissect_h245_MultimediaSystemControlMessage(tvb, offset, &asn1_ctx, tr, hf_h245_pdu_type);
440 tap_queue_packet(h245dg_tap, pinfo, h245_pi);
441 offset = (offset+0x07) & 0xfffffff8;
442 CLEANUP_CALL_AND_POP;
446 void
447 dissect_h245_FastStart_OLC(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, char *codec_str) {
449 fast_start = TRUE;
450 /* Clean up from any previous packet dissection */
451 upcoming_olc = NULL;
452 upcoming_channel = NULL;
453 codec_type = NULL;
455 dissect_OpenLogicalChannel_PDU(tvb, pinfo, tree);
457 if (h245_pi != NULL)
458 h245_pi->msg_type = H245_OpenLogChn;
460 if (codec_str && codec_type){
461 g_strlcpy(codec_str, codec_type, 50);
466 /*--- proto_register_h245 -------------------------------------------*/
467 void proto_register_h245(void) {
469 /* List of fields */
470 static hf_register_info hf[] = {
471 { &hf_h245_pdu_type,
472 { "PDU Type", "h245.pdu_type", FT_UINT32, BASE_DEC,
473 VALS(h245_MultimediaSystemControlMessage_vals), 0, "Type of H.245 PDU", HFILL }},
474 { &hf_h245Manufacturer,
475 { "H.245 Manufacturer", "h245.Manufacturer", FT_UINT32, BASE_HEX,
476 VALS(H221ManufacturerCode_vals), 0, "h245.H.221 Manufacturer", HFILL }},
477 { &hf_h245_subMessageIdentifier_standard,
478 { "subMessageIdentifier", "h245.subMessageIdentifier.standard",
479 FT_UINT32, BASE_DEC, VALS(h245_h239subMessageIdentifier_vals), 0,
480 NULL, HFILL }},
482 #include "packet-h245-hfarr.c"
485 /* List of subtrees */
486 static gint *ett[] = {
487 &ett_h245,
488 &ett_h245_returnedFunction,
489 #include "packet-h245-ettarr.c"
491 module_t *h245_module;
493 /* Register protocol */
494 proto_h245 = proto_register_protocol(PNAME, PSNAME, PFNAME);
495 register_init_routine(h245_init);
496 /* Register fields and subtrees */
497 proto_register_field_array(proto_h245, hf, array_length(hf));
498 proto_register_subtree_array(ett, array_length(ett));
500 /* From Ronnie Sahlbergs original H245 dissector */
502 h245_module = prefs_register_protocol(proto_h245, NULL);
503 prefs_register_bool_preference(h245_module, "reassembly",
504 "Reassemble H.245 messages spanning multiple TCP segments",
505 "Whether the H.245 dissector should reassemble messages spanning multiple TCP segments."
506 " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
507 &h245_reassembly);
508 prefs_register_bool_preference(h245_module, "shorttypes",
509 "Show short message types",
510 "Whether the dissector should show short names or the long names from the standard",
511 &h245_shorttypes);
512 register_dissector("h245dg", dissect_h245_h245, proto_h245);
513 register_dissector("h245", dissect_h245, proto_h245);
515 nsp_object_dissector_table = register_dissector_table("h245.nsp.object", "H.245 NonStandardParameter (object)", FT_STRING, BASE_NONE);
516 nsp_h221_dissector_table = register_dissector_table("h245.nsp.h221", "H.245 NonStandardParameter (h221)", FT_UINT32, BASE_HEX);
517 gef_name_dissector_table = register_dissector_table("h245.gef.name", "H.245 Generic Extensible Framework (names)", FT_STRING, BASE_NONE);
518 gef_content_dissector_table = register_dissector_table("h245.gef.content", "H.245 Generic Extensible Framework", FT_STRING, BASE_NONE);
520 h245_tap = register_tap("h245");
521 h245dg_tap = register_tap("h245dg");
523 oid_add_from_string("h239ControlCapability","0.0.8.239.1.1");
524 oid_add_from_string("h239ExtendedVideoCapability","0.0.8.239.1.2");
525 oid_add_from_string("generic-message","0.0.8.239.2");
526 oid_add_from_string("h245 version 3","0.0.8.245.0.3");
527 oid_add_from_string("h245 version 4","0.0.8.245.0.4");
528 oid_add_from_string("h245 version 5","0.0.8.245.0.5");
529 oid_add_from_string("h245 version 6","0.0.8.245.0.6");
530 oid_add_from_string("h245 version 7","0.0.8.245.0.7");
531 oid_add_from_string("h245 version 8","0.0.8.245.0.8");
532 oid_add_from_string("h245 version 9","0.0.8.245.0.9");
533 oid_add_from_string("h245 version 10","0.0.8.245.0.10");
534 oid_add_from_string("h245 version 11","0.0.8.245.0.11");
535 oid_add_from_string("h245 version 12","0.0.8.245.0.12");
536 oid_add_from_string("h245 version 13","0.0.8.245.0.13");
537 /* This capability is defined in Annex E. */
538 oid_add_from_string("ISO/IEC 14496-2 MPEG-4 video","0.0.8.245.1.0.0");
539 /* This capability is defined in Annex H. */
540 oid_add_from_string("ISO/IEC 14496-3 MPEG-4 audio","0.0.8.245.1.1.0");
541 /* This capability is defined in Annex I. */
542 oid_add_from_string("AMR","0.0.8.245.1.1.1");
543 /* This capability is defined in Annex J. */
544 oid_add_from_string("acelp","0.0.8.245.1.1.2");
545 /* This capability is defined in Annex K. */
546 oid_add_from_string("us1","0.0.8.245.1.1.3");
547 /* This capability is defined in Annex L. */
548 oid_add_from_string("is127evrc","0.0.8.245.1.1.4");
549 /* This capability is defined in Annex M. */
550 oid_add_from_string("ISO/IEC 13818-7","0.0.8.245.1.1.5");
551 /* This capability is defined in Annex N. */
552 oid_add_from_string("rfc3389","0.0.8.245.1.1.6");
553 /* This capability is defined in Annex O. */
554 oid_add_from_string("L-16","0.0.8.245.1.1.7");
555 /* This capability is defined in Annex P. */
556 oid_add_from_string("bounded-audio-stream","0.0.8.245.1.1.8");
557 /* This capability is defined in Annex R. */
558 oid_add_from_string("AMR-NB","0.0.8.245.1.1.9");
559 /* This capability is defined in Annex R. */
560 oid_add_from_string("AMR-WB","0.0.8.245.1.1.10");
561 /* This capability is defined in Annex S. */
562 oid_add_from_string("ilbc","0.0.8.245.1.1.11");
564 oid_add_from_string("ISO/IEC 14496-1","0.0.8.245.1.2.0");
565 oid_add_from_string("Nx64","0.0.8.245.1.2.1");
566 oid_add_from_string("logical-channel-bit-ratemanagement","0.0.8.245.1.3.0");
568 oid_add_from_string("h264 generic-capabilities","0.0.8.241.0.0.1");
569 oid_add_from_string("iPpacketization_h241AnnexA(single NAL unit mode)","0.0.8.241.0.0.0.0");
570 oid_add_from_string("iPpacketization_RFC3984NonInterleaved","0.0.8.241.0.0.0.1");
571 oid_add_from_string("iPpacketization_RFC3984Interleaved","0.0.8.241.0.0.0.2");
575 /*--- proto_reg_handoff_h245 ---------------------------------------*/
576 void proto_reg_handoff_h245(void) {
577 dissector_handle_t h245_handle;
579 rtcp_handle = find_dissector("rtcp");
580 data_handle = find_dissector("data");
581 h263_handle = find_dissector("h263data");
582 amr_handle = find_dissector("amr_if2_nb");
585 h245_handle = find_dissector("h245");
586 dissector_add_handle("tcp.port", h245_handle);
587 MultimediaSystemControlMessage_handle = find_dissector("h245dg");
588 dissector_add_handle("udp.port", MultimediaSystemControlMessage_handle);
591 static void init_h245_packet_info(h245_packet_info *pi)
593 if(pi == NULL) {
594 return;
597 pi->msg_type = H245_OTHER;
598 pi->frame_label[0] = '\0';
599 g_snprintf(pi->comment, sizeof(pi->comment), "H245 ");