Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / asn1 / h245 / packet-h245-template.c
blob41d15b32ae569b7f508a0314681033588ecb6775
1 /* packet-h245_asn1.c
2 * Routines for h245 packet dissection
3 * Copyright 2004, Anders Broman <anders.broman@ericsson.com>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
11 * To quote the author of the previous H245 dissector:
12 * "This is a complete replacement of the previous limitied dissector
13 * that Ronnie was crazy enough to write by hand. It was a lot of time
14 * to hack it by hand, but it is incomplete and buggy and it is good when
15 * it will go away."
16 * Ronnie did a great job and all the VoIP users had made good use of it!
17 * Credit to Tomas Kukosa for developing the asn2wrs compiler.
21 #include "config.h"
23 #include <epan/packet.h>
24 #include <epan/exceptions.h>
25 #include <epan/strutil.h>
26 #include <epan/addr_resolv.h>
27 #include <epan/prefs.h>
28 #include <epan/t35.h>
29 #include <epan/oids.h>
30 #include <epan/asn1.h>
31 #include <epan/proto_data.h>
32 #include <epan/tap.h>
33 #include <wsutil/pint.h>
34 #include <wsutil/array.h>
35 #include "packet-tpkt.h"
36 #include "packet-per.h"
37 #include "packet-h323.h"
38 #include "packet-h245.h"
39 #include "packet-rtp.h"
40 #include "packet-rtcp.h"
41 #include "packet-t38.h"
43 #define PNAME "MULTIMEDIA-SYSTEM-CONTROL"
44 #define PSNAME "H.245"
45 #define PFNAME "h245"
47 void proto_register_h245(void);
48 void proto_reg_handoff_h245(void);
50 static dissector_handle_t rtcp_handle;
51 static dissector_table_t nsp_object_dissector_table;
52 static dissector_table_t nsp_h221_dissector_table;
53 static dissector_table_t gef_name_dissector_table;
54 static dissector_table_t gef_content_dissector_table;
55 static dissector_handle_t h245_handle;
56 static dissector_handle_t nsp_handle;
57 static dissector_handle_t data_handle;
58 static dissector_handle_t MultimediaSystemControlMessage_handle;
59 static dissector_handle_t h263_handle;
60 static dissector_handle_t amr_handle;
62 static void init_h245_packet_info(h245_packet_info *pi);
63 static int hf_h245_pdu_type;
64 static int hf_h245Manufacturer;
65 static int hf_h245_subMessageIdentifier_standard;
66 static int h245_tap;
67 static int h245dg_tap;
68 static int hf_h245_debug_dissector_try_string;
70 h245_packet_info *h245_pi=NULL;
72 static bool h245_reassembly = true;
73 static bool h245_shorttypes;
74 static bool info_col_fmt_prepend;
76 #include "packet-h245-val.h"
78 static const value_string h245_RequestMessage_short_vals[] = {
79 { RequestMessage_nonStandard , "NSM" },
80 { RequestMessage_masterSlaveDetermination , "MSD" },
81 { RequestMessage_terminalCapabilitySet , "TCS" },
82 { RequestMessage_openLogicalChannel , "OLC" },
83 { RequestMessage_closeLogicalChannel , "CLC" },
84 { RequestMessage_requestChannelClose , "RCC" },
85 { RequestMessage_multiplexEntrySend , "MES" },
86 { RequestMessage_requestMultiplexEntry , "RME" },
87 { RequestMessage_requestMode , "RM" },
88 { RequestMessage_roundTripDelayRequest , "RTDR" },
89 { RequestMessage_maintenanceLoopRequest , "MLR" },
90 { RequestMessage_communicationModeRequest , "CMR" },
91 { RequestMessage_conferenceRequest , "CR" },
92 { RequestMessage_multilinkRequest , "MR" },
93 { RequestMessage_logicalChannelRateRequest, "LCRR" },
94 { RequestMessage_genericRequest , "GR" },
95 { 0, NULL }
97 static const value_string h245_ResponseMessage_short_vals[] = {
98 { ResponseMessage_nonStandard , "NSM" },
99 { ResponseMessage_masterSlaveDeterminationAck , "MSDAck" },
100 { ResponseMessage_masterSlaveDeterminationReject, "MSDReject" },
101 { ResponseMessage_terminalCapabilitySetAck , "TCSAck" },
102 { ResponseMessage_terminalCapabilitySetReject , "TCSReject" },
103 { ResponseMessage_openLogicalChannelAck , "OLCAck" },
104 { ResponseMessage_openLogicalChannelReject , "OLCReject" },
105 { ResponseMessage_closeLogicalChannelAck , "CLCAck" },
106 { ResponseMessage_requestChannelCloseAck , "RCCAck" },
107 { ResponseMessage_requestChannelCloseReject , "RCCReject" },
108 { ResponseMessage_multiplexEntrySendAck , "MESAck" },
109 { ResponseMessage_multiplexEntrySendReject , "MESReject" },
110 { ResponseMessage_requestMultiplexEntryAck , "RMEAck" },
111 { ResponseMessage_requestMultiplexEntryReject , "RMEReject" },
112 { ResponseMessage_requestModeAck , "RMAck" },
113 { ResponseMessage_requestModeReject , "RMReject" },
114 { ResponseMessage_roundTripDelayResponse , "RTDResponse" },
115 { ResponseMessage_maintenanceLoopAck , "MLAck" },
116 { ResponseMessage_maintenanceLoopReject , "MLReject" },
117 { ResponseMessage_communicationModeResponse , "CMResponse" },
118 { ResponseMessage_conferenceResponse , "CResponse" },
119 { ResponseMessage_multilinkResponse , "MResponse" },
120 { ResponseMessage_logicalChannelRateAcknowledge , "LCRAck" },
121 { ResponseMessage_logicalChannelRateReject , "LCRReject" },
122 { ResponseMessage_genericResponse , "GR" },
123 { 0, NULL }
125 static const value_string h245_IndicationMessage_short_vals[] = {
126 { IndicationMessage_nonStandard , "NSM" },
127 { IndicationMessage_functionNotUnderstood , "FNU" },
128 { IndicationMessage_masterSlaveDeterminationRelease , "MSDRelease" },
129 { IndicationMessage_terminalCapabilitySetRelease , "TCSRelease" },
130 { IndicationMessage_openLogicalChannelConfirm , "OLCConfirm" },
131 { IndicationMessage_requestChannelCloseRelease , "RCCRelease" },
132 { IndicationMessage_multiplexEntrySendRelease , "MESRelease" },
133 { IndicationMessage_requestMultiplexEntryRelease , "RMERelease" },
134 { IndicationMessage_requestModeRelease , "RMRelease" },
135 { IndicationMessage_miscellaneousIndication , "MI" },
136 { IndicationMessage_jitterIndication , "JI" },
137 { IndicationMessage_h223SkewIndication , "H223SI" },
138 { IndicationMessage_newATMVCIndication , "NATMVCI" },
139 { IndicationMessage_userInput , "UII" },
140 { IndicationMessage_h2250MaximumSkewIndication , "H2250MSI" },
141 { IndicationMessage_mcLocationIndication , "MCLI" },
142 { IndicationMessage_conferenceIndication , "CI" },
143 { IndicationMessage_vendorIdentification , "VI" },
144 { IndicationMessage_functionNotSupported , "FNS" },
145 { IndicationMessage_multilinkIndication , "MultilinkIndication" },
146 { IndicationMessage_logicalChannelRateRelease , "LCRRelease" },
147 { IndicationMessage_flowControlIndication , "FCIndication" },
148 { IndicationMessage_mobileMultilinkReconfigurationIndication, "MMRI" },
149 { IndicationMessage_genericIndication , "GI" },
150 { 0, NULL }
152 static const value_string h245_CommandMessage_short_vals[] = {
153 { CommandMessage_nonStandard , "NSM" },
154 { CommandMessage_maintenanceLoopOffCommand , "MLOC" },
155 { CommandMessage_sendTerminalCapabilitySet , "STCS" },
156 { CommandMessage_encryptionCommand , "EC" },
157 { CommandMessage_flowControlCommand , "FCC" },
158 { CommandMessage_endSessionCommand , "ESC" },
159 { CommandMessage_miscellaneousCommand , "MC" },
160 { CommandMessage_communicationModeCommand , "CMC" },
161 { CommandMessage_conferenceCommand , "CC" },
162 { CommandMessage_h223MultiplexReconfiguration , "H223MR" },
163 { CommandMessage_newATMVCCommand , "NATMVCC" },
164 { CommandMessage_mobileMultilinkReconfigurationCommand, "MMRC" },
165 { CommandMessage_genericCommand , "GC" },
166 { 0, NULL }
169 static const value_string h245_AudioCapability_short_vals[] = {
170 { AudioCapability_nonStandard , "nonStd" },
171 { AudioCapability_g711Alaw64k , "g711A" },
172 { AudioCapability_g711Alaw56k , "g711A56k" },
173 { AudioCapability_g711Ulaw64k , "g711U" },
174 { AudioCapability_g711Ulaw56k , "g711U56k" },
175 { AudioCapability_g722_64k , "g722-64k" },
176 { AudioCapability_g722_56k , "g722-56k" },
177 { AudioCapability_g722_48k , "g722-48k" },
178 { AudioCapability_g7231 , "g7231" },
179 { AudioCapability_g728 , "g728" },
180 { AudioCapability_g729 , "g729" },
181 { AudioCapability_g729AnnexA , "g729A" },
182 { AudioCapability_is11172AudioCapability, "is11172" },
183 { AudioCapability_is13818AudioCapability, "is13818" },
184 { AudioCapability_g729wAnnexB , "g729B" },
185 { AudioCapability_g729AnnexAwAnnexB , "g729AB" },
186 { AudioCapability_g7231AnnexCCapability , "g7231C" },
187 { AudioCapability_gsmFullRate , "gsmFR" },
188 { AudioCapability_gsmHalfRate , "gsmHR" },
189 { AudioCapability_gsmEnhancedFullRate , "gsmEFR" },
190 { AudioCapability_genericAudioCapability, "generic" },
191 { AudioCapability_g729Extensions , "g729Ext" },
192 { AudioCapability_vbd , "vbd" },
193 { AudioCapability_audioTelephonyEvent , "audioTelEvent" },
194 { AudioCapability_audioTone , "audioTone" },
195 { 0, NULL }
198 /* To put the codec type only in COL_INFO when
199 an OLC is read */
200 const char* codec_type;
201 static uint32_t rfc_number;
203 typedef struct _unicast_addr_t {
204 address addr;
205 uint8_t addr_buf[16];
206 uint32_t port;
207 } unicast_addr_t;
209 typedef struct _channel_info_t {
210 char data_type_str[32];
211 unicast_addr_t *upcoming_addr;
212 unicast_addr_t media_addr;
213 unicast_addr_t media_control_addr;
214 unsigned int rfc2198;
215 bool srtp_flag;
216 bool is_video;
217 } channel_info_t;
219 typedef struct _olc_info_t {
220 uint16_t fwd_lc_num;
221 channel_info_t fwd_lc;
222 channel_info_t rev_lc;
223 } olc_info_t;
225 static wmem_map_t* h245_pending_olc_reqs;
226 static bool fast_start;
227 static olc_info_t *upcoming_olc;
228 static channel_info_t *upcoming_channel;
230 /* NonStandardParameter */
231 static const char *nsiOID;
232 static uint32_t h221NonStandard;
233 static uint32_t t35CountryCode;
234 static uint32_t t35Extension;
235 static uint32_t manufacturerCode;
237 static const value_string h245_RFC_number_vals[] = {
238 { 2190, "RFC 2190 - H.263 Video Streams" },
239 { 2198, "RFC 2198 - RTP Payload for Redundant Audio Data" },
240 { 2429, "RFC 2429 - 1998 Version of ITU-T Rec. H.263 Video (H.263+)" },
241 { 3016, "RFC 3016 - RTP Payload Format for MPEG-4 Audio/Visual Streams" },
242 { 3267, "RFC 3267 - Adaptive Multi-Rate (AMR) and Adaptive Multi-Rate Wideband (AMR-WB)" },
243 { 3984, "RFC 3984 - RTP Payload Format for H.264 Video" },
244 { 0, NULL }
247 /* Table 7/H.239 subMessageIdentifier values */
248 static const value_string h245_h239subMessageIdentifier_vals[] = {
249 { 1, "flowControlReleaseRequest" },
250 { 2, "flowControlReleaseResponse" },
251 { 3, "presentationTokenRequest" },
252 { 4, "presentationTokenResponse" },
253 { 5, "presentationTokenRelease" },
254 { 6, "presentationTokenIndicateOwner" },
255 { 0, NULL }
259 /* h223 multiplex codes */
260 static h223_set_mc_handle_t h223_set_mc_handle;
261 h223_mux_element *h223_me=NULL;
262 uint8_t h223_mc=0;
263 void h245_set_h223_set_mc_handle( h223_set_mc_handle_t handle )
265 h223_set_mc_handle = handle;
268 /* h223 logical channels */
269 typedef struct {
270 h223_lc_params *fw_channel_params;
271 h223_lc_params *rev_channel_params;
272 } h223_pending_olc;
274 static wmem_map_t* h223_pending_olc_reqs[2];
275 static dissector_handle_t h245_lc_dissector;
276 static uint16_t h245_lc_temp;
277 static uint16_t h223_fw_lc_num;
278 static uint16_t h223_rev_lc_num;
279 static h223_lc_params *h223_lc_params_temp;
280 static h223_lc_params *h223_fw_lc_params;
281 static h223_lc_params *h223_rev_lc_params;
282 static h223_add_lc_handle_t h223_add_lc_handle;
284 static void h223_lc_init( void )
286 h223_lc_params_temp = NULL;
287 h245_lc_dissector = NULL;
288 h223_fw_lc_num = 0;
291 void h245_set_h223_add_lc_handle( h223_add_lc_handle_t handle )
293 h223_add_lc_handle = handle;
296 static const char *gen_olc_key(uint16_t lc_num, address *dst_addr, address *src_addr, wmem_allocator_t *scope)
298 return wmem_strdup_printf(scope, "%s/%s/%u",
299 address_to_str(scope, dst_addr),
300 address_to_str(scope, src_addr),
301 lc_num);
304 static void update_unicast_addr(unicast_addr_t *req_addr, unicast_addr_t *ack_addr)
306 if (ack_addr->addr.type!=AT_NONE && ack_addr->port!=0) {
307 memcpy(req_addr->addr_buf, ack_addr->addr_buf, sizeof(req_addr->addr_buf));
308 set_address(&req_addr->addr, ack_addr->addr.type, ack_addr->addr.len, req_addr->addr_buf);
309 req_addr->port = ack_addr->port;
313 static void h245_setup_channels(packet_info *pinfo, channel_info_t *upcoming_channel_lcl)
315 rtp_dyn_payload_t *rtp_dyn_payload = NULL;
316 struct srtp_info *dummy_srtp_info = NULL;
318 if (!upcoming_channel_lcl) return;
320 /* T.38 */
321 if (!strcmp(upcoming_channel_lcl->data_type_str, "t38fax")) {
322 if (upcoming_channel_lcl->media_addr.addr.type!=AT_NONE && upcoming_channel_lcl->media_addr.port!=0) {
323 t38_add_address(pinfo, &upcoming_channel_lcl->media_addr.addr,
324 upcoming_channel_lcl->media_addr.port, 0,
325 "H245", pinfo->num);
327 return;
330 /* (S)RTP, (S)RTCP */
331 if (upcoming_channel_lcl->rfc2198 > 0) {
332 rtp_dyn_payload = rtp_dyn_payload_new();
333 rtp_dyn_payload_insert(rtp_dyn_payload, upcoming_channel_lcl->rfc2198, "red", 8000, 1);
336 if (upcoming_channel_lcl->srtp_flag) {
337 dummy_srtp_info = wmem_new0(wmem_file_scope(), struct srtp_info);
340 /* DEBUG ws_warning("h245_setup_channels media_addr.addr.type %u port %u",upcoming_channel_lcl->media_addr.addr.type, upcoming_channel_lcl->media_addr.port );
342 if (upcoming_channel_lcl->media_addr.addr.type!=AT_NONE && upcoming_channel_lcl->media_addr.port!=0) {
343 srtp_add_address(pinfo, PT_UDP, &upcoming_channel_lcl->media_addr.addr,
344 upcoming_channel_lcl->media_addr.port, 0,
345 "H245", pinfo->num, upcoming_channel_lcl->is_video , rtp_dyn_payload, dummy_srtp_info, NULL);
347 if (upcoming_channel_lcl->media_control_addr.addr.type!=AT_NONE && upcoming_channel_lcl->media_control_addr.port!=0 && rtcp_handle) {
348 srtcp_add_address(pinfo, &upcoming_channel_lcl->media_control_addr.addr,
349 upcoming_channel_lcl->media_control_addr.port, 0,
350 "H245", pinfo->num, dummy_srtp_info);
354 /* Prints formated information column of h245 messages. Note that global variables
355 * "h245_shorttypes" and "info_col_fmt_prepend" are used to decide formating preferences */
356 static void print_info_column(column_info *cinfo, const int32_t *value,
357 const value_string *msg_vals, const value_string *short_msg_vals)
359 const value_string *vals;
361 if (h245_shorttypes == false || short_msg_vals == NULL) {
362 vals = msg_vals;
363 } else {
364 vals = short_msg_vals;
367 if (info_col_fmt_prepend == false) {
368 col_append_fstr(cinfo, COL_INFO, "%s ", val_to_str_const(*value, vals, "<unknown>"));
369 } else {
370 col_prepend_fstr(cinfo, COL_INFO, "%s ", val_to_str_const(*value, vals, "<unknown>"));
374 /* Initialize the protocol and registered fields */
375 static int proto_h245;
376 #include "packet-h245-hf.c"
378 /* Initialize the subtree pointers */
379 static int ett_h245;
380 static int ett_h245_returnedFunction;
381 #include "packet-h245-ett.c"
383 /* Forward declarations */
384 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_);
385 static void reset_h245_pi(void *dummy _U_)
387 h245_pi = NULL; /* Make sure we don't leave pinfo->pool memory lying around */
390 #include "packet-h245-fn.c"
392 static int
393 dissect_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_)
396 * MultimediaSystemControlMessage_handle is the handle for
397 * dissect_h245_h245, so we don't want to do any h245_pi or tap stuff here.
399 dissect_tpkt_encap(tvb, pinfo, parent_tree, h245_reassembly, MultimediaSystemControlMessage_handle);
400 return tvb_captured_length(tvb);
404 static int
405 dissect_h245_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_)
407 proto_item *it;
408 proto_tree *tr;
409 uint32_t offset=0;
410 asn1_ctx_t asn1_ctx;
412 fast_start = false;
413 /* Clean up from any previous packet dissection */
414 upcoming_olc = NULL;
415 upcoming_channel = NULL;
416 codec_type = NULL;
418 col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME);
420 it=proto_tree_add_protocol_format(parent_tree, proto_h245, tvb, 0, -1, PSNAME);
421 tr=proto_item_add_subtree(it, ett_h245);
423 /* assume that whilst there is more tvb data, there are more h245 commands */
424 while ( tvb_reported_length_remaining( tvb, offset>>3 )>0 ){
425 CLEANUP_PUSH(reset_h245_pi, NULL);
426 h245_pi=wmem_new(pinfo->pool, h245_packet_info);
427 init_h245_packet_info(h245_pi);
428 asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, true, pinfo);
429 offset = dissect_h245_MultimediaSystemControlMessage(tvb, offset, &asn1_ctx, tr, hf_h245_pdu_type);
430 tap_queue_packet(h245dg_tap, pinfo, h245_pi);
431 offset = (offset+0x07) & 0xfffffff8;
432 CLEANUP_CALL_AND_POP;
434 return tvb_captured_length(tvb);
437 void
438 dissect_h245_FastStart_OLC(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, char *codec_str) {
440 fast_start = true;
441 /* Clean up from any previous packet dissection */
442 upcoming_olc = NULL;
443 upcoming_channel = NULL;
444 codec_type = NULL;
446 dissect_OpenLogicalChannel_PDU(tvb, pinfo, tree, NULL);
448 if (h245_pi != NULL)
449 h245_pi->msg_type = H245_OpenLogChn;
451 if (codec_str && codec_type){
452 (void) g_strlcpy(codec_str, codec_type, 50);
457 /*--- proto_register_h245 -------------------------------------------*/
458 void proto_register_h245(void) {
460 /* List of fields */
461 static hf_register_info hf[] = {
462 { &hf_h245_pdu_type,
463 { "PDU Type", "h245.pdu_type", FT_UINT32, BASE_DEC,
464 VALS(h245_MultimediaSystemControlMessage_vals), 0, "Type of H.245 PDU", HFILL }},
465 { &hf_h245Manufacturer,
466 { "H.245 Manufacturer", "h245.Manufacturer", FT_UINT32, BASE_HEX,
467 VALS(H221ManufacturerCode_vals), 0, "h245.H.221 Manufacturer", HFILL }},
468 { &hf_h245_subMessageIdentifier_standard,
469 { "subMessageIdentifier", "h245.subMessageIdentifier.standard",
470 FT_UINT32, BASE_DEC, VALS(h245_h239subMessageIdentifier_vals), 0,
471 NULL, HFILL }},
472 { &hf_h245_debug_dissector_try_string,
473 { "*** DEBUG dissector_try_string", "h245.debug.dissector_try_string", FT_STRING, BASE_NONE,
474 NULL, 0, NULL, HFILL }},
476 #include "packet-h245-hfarr.c"
479 /* List of subtrees */
480 static int *ett[] = {
481 &ett_h245,
482 &ett_h245_returnedFunction,
483 #include "packet-h245-ettarr.c"
485 module_t *h245_module;
487 /* Register protocol */
488 proto_h245 = proto_register_protocol(PNAME, PSNAME, PFNAME);
489 h223_pending_olc_reqs[P2P_DIR_SENT] = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_direct_hash, g_direct_equal );
490 h223_pending_olc_reqs[P2P_DIR_RECV] = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_direct_hash, g_direct_equal );
491 h245_pending_olc_reqs = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), wmem_str_hash, g_str_equal);
493 register_init_routine(h223_lc_init);
494 /* Register fields and subtrees */
495 proto_register_field_array(proto_h245, hf, array_length(hf));
496 proto_register_subtree_array(ett, array_length(ett));
498 /* From Ronnie Sahlbergs original H245 dissector */
500 h245_module = prefs_register_protocol(proto_h245, NULL);
501 prefs_register_bool_preference(h245_module, "reassembly",
502 "Reassemble H.245 messages spanning multiple TCP segments",
503 "Whether the H.245 dissector should reassemble messages spanning multiple TCP segments."
504 " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
505 &h245_reassembly);
506 prefs_register_bool_preference(h245_module, "shorttypes",
507 "Show short message types",
508 "Whether the dissector should show short names or the long names from the standard",
509 &h245_shorttypes);
510 prefs_register_bool_preference(h245_module, "prepand",
511 "Show h245 info in reversed order",
512 "Whether the dissector should print items of h245 Info column in reversed order",
513 &info_col_fmt_prepend);
514 MultimediaSystemControlMessage_handle = register_dissector("h245dg", dissect_h245_h245, proto_h245);
515 h245_handle = register_dissector("h245", dissect_h245, proto_h245);
517 nsp_object_dissector_table = register_dissector_table("h245.nsp.object", "H.245 NonStandardParameter (object)", proto_h245, FT_STRING, STRING_CASE_SENSITIVE);
518 nsp_h221_dissector_table = register_dissector_table("h245.nsp.h221", "H.245 NonStandardParameter (h221)", proto_h245, FT_UINT32, BASE_HEX);
519 gef_name_dissector_table = register_dissector_table("h245.gef.name", "H.245 Generic Extensible Framework Name", proto_h245, FT_STRING, STRING_CASE_SENSITIVE);
520 gef_content_dissector_table = register_dissector_table("h245.gef.content", "H.245 Generic Extensible Framework Content", proto_h245, FT_STRING, STRING_CASE_SENSITIVE);
522 h245_tap = register_tap("h245");
523 h245dg_tap = register_tap("h245dg");
525 oid_add_from_string("h239ControlCapability","0.0.8.239.1.1");
526 oid_add_from_string("h239ExtendedVideoCapability","0.0.8.239.1.2");
527 oid_add_from_string("generic-message","0.0.8.239.2");
528 oid_add_from_string("h245 version 3","0.0.8.245.0.3");
529 oid_add_from_string("h245 version 4","0.0.8.245.0.4");
530 oid_add_from_string("h245 version 5","0.0.8.245.0.5");
531 oid_add_from_string("h245 version 6","0.0.8.245.0.6");
532 oid_add_from_string("h245 version 7","0.0.8.245.0.7");
533 oid_add_from_string("h245 version 8","0.0.8.245.0.8");
534 oid_add_from_string("h245 version 9","0.0.8.245.0.9");
535 oid_add_from_string("h245 version 10","0.0.8.245.0.10");
536 oid_add_from_string("h245 version 11","0.0.8.245.0.11");
537 oid_add_from_string("h245 version 12","0.0.8.245.0.12");
538 oid_add_from_string("h245 version 13","0.0.8.245.0.13");
539 /* This capability is defined in Annex E. */
540 oid_add_from_string("ISO/IEC 14496-2 MPEG-4 video","0.0.8.245.1.0.0");
541 /* This capability is defined in Annex H. */
542 oid_add_from_string("ISO/IEC 14496-3 MPEG-4 audio","0.0.8.245.1.1.0");
543 /* This capability is defined in Annex I. */
544 oid_add_from_string("AMR","0.0.8.245.1.1.1");
545 /* This capability is defined in Annex J. */
546 oid_add_from_string("acelp","0.0.8.245.1.1.2");
547 /* This capability is defined in Annex K. */
548 oid_add_from_string("us1","0.0.8.245.1.1.3");
549 /* This capability is defined in Annex L. */
550 oid_add_from_string("is127evrc","0.0.8.245.1.1.4");
551 /* This capability is defined in Annex M. */
552 oid_add_from_string("ISO/IEC 13818-7","0.0.8.245.1.1.5");
553 /* This capability is defined in Annex N. */
554 oid_add_from_string("rfc3389","0.0.8.245.1.1.6");
555 /* This capability is defined in Annex O. */
556 oid_add_from_string("L-16","0.0.8.245.1.1.7");
557 /* This capability is defined in Annex P. */
558 oid_add_from_string("bounded-audio-stream","0.0.8.245.1.1.8");
559 /* This capability is defined in Annex R. */
560 oid_add_from_string("AMR-NB","0.0.8.245.1.1.9");
561 /* This capability is defined in Annex R. */
562 oid_add_from_string("AMR-WB","0.0.8.245.1.1.10");
563 /* This capability is defined in Annex S. */
564 oid_add_from_string("ilbc","0.0.8.245.1.1.11");
566 oid_add_from_string("ISO/IEC 14496-1","0.0.8.245.1.2.0");
567 oid_add_from_string("Nx64","0.0.8.245.1.2.1");
568 oid_add_from_string("logical-channel-bit-ratemanagement","0.0.8.245.1.3.0");
570 oid_add_from_string("h264 generic-capabilities","0.0.8.241.0.0.1");
571 oid_add_from_string("iPpacketization_h241AnnexA(single NAL unit mode)","0.0.8.241.0.0.0.0");
572 oid_add_from_string("iPpacketization_RFC3984NonInterleaved","0.0.8.241.0.0.0.1");
573 oid_add_from_string("iPpacketization_RFC3984Interleaved","0.0.8.241.0.0.0.2");
577 /*--- proto_reg_handoff_h245 ---------------------------------------*/
578 void proto_reg_handoff_h245(void) {
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 dissector_add_for_decode_as_with_preference("tcp.port", h245_handle);
586 dissector_add_for_decode_as_with_preference("udp.port", MultimediaSystemControlMessage_handle);
589 static void init_h245_packet_info(h245_packet_info *pi)
591 if(pi == NULL) {
592 return;
595 pi->msg_type = H245_OTHER;
596 pi->frame_label[0] = '\0';
597 snprintf(pi->comment, sizeof(pi->comment), "H245 ");