2 * Routines for SDP packet disassembly (RFC 2327)
4 * Jason Lango <jal@netapp.com>
5 * Liberally copied from packet-http.c, by Guy Harris <guy@alum.mit.edu>
7 * $Id: packet-sdp.c,v 1.34 2003/06/12 08:33:29 guy Exp $
9 * Ethereal - Network traffic analyzer
10 * By Gerald Combs <gerald@ethereal.com>
11 * Copyright 1998 Gerald Combs
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 #include <epan/packet.h>
35 #include <epan/strutil.h>
37 static int proto_sdp = -1;
39 /* Top level fields */
40 static int hf_protocol_version = -1;
41 static int hf_owner = -1;
42 static int hf_session_name = -1;
43 static int hf_session_info = -1;
44 static int hf_uri = -1;
45 static int hf_email = -1;
46 static int hf_phone = -1;
47 static int hf_connection_info = -1;
48 static int hf_bandwidth = -1;
49 static int hf_timezone = -1;
50 static int hf_encryption_key = -1;
51 static int hf_session_attribute = -1;
52 static int hf_media_attribute = -1;
53 static int hf_time = -1;
54 static int hf_repeat_time = -1;
55 static int hf_media = -1;
56 static int hf_media_title = -1;
57 static int hf_unknown = -1;
58 static int hf_invalid = -1;
60 /* hf_owner subfields*/
61 static int hf_owner_username = -1;
62 static int hf_owner_sessionid = -1;
63 static int hf_owner_version = -1;
64 static int hf_owner_network_type = -1;
65 static int hf_owner_address_type = -1;
66 static int hf_owner_address = -1;
68 /* hf_connection_info subfields */
69 static int hf_connection_info_network_type = -1;
70 static int hf_connection_info_address_type = -1;
71 static int hf_connection_info_connection_address = -1;
72 static int hf_connection_info_ttl = -1;
73 static int hf_connection_info_num_addr = -1;
75 /* hf_bandwidth subfields */
76 static int hf_bandwidth_modifier = -1;
77 static int hf_bandwidth_value = -1;
79 /* hf_time subfields */
80 static int hf_time_start = -1;
81 static int hf_time_stop = -1;
83 /* hf_repeat_time subfield */
84 static int hf_repeat_time_interval = -1;
85 static int hf_repeat_time_duration = -1;
86 static int hf_repeat_time_offset = -1;
88 /* hf_timezone subfields */
89 static int hf_timezone_time = -1;
90 static int hf_timezone_offset = -1;
92 /* hf_encryption_key subfields */
93 static int hf_encryption_key_type = -1;
94 static int hf_encryption_key_data = -1;
96 /* hf_session_attribute subfields */
97 static int hf_session_attribute_field = -1;
98 static int hf_session_attribute_value = -1;
100 /* hf_media subfields */
101 static int hf_media_media = -1;
102 static int hf_media_port = -1;
103 static int hf_media_portcount = -1;
104 static int hf_media_proto = -1;
105 static int hf_media_format = -1;
107 /* hf_session_attribute subfields */
108 static int hf_media_attribute_field = -1;
109 static int hf_media_attribute_value = -1;
112 static int ett_sdp = -1;
113 static int ett_sdp_owner = -1;
114 static int ett_sdp_connection_info = -1;
115 static int ett_sdp_bandwidth = -1;
116 static int ett_sdp_time = -1;
117 static int ett_sdp_repeat_time = -1;
118 static int ett_sdp_timezone = -1;
119 static int ett_sdp_encryption_key = -1;
120 static int ett_sdp_session_attribute = -1;
121 static int ett_sdp_media = -1;
122 static int ett_sdp_media_attribute = -1;
124 /* static functions */
126 static void call_sdp_subdissector(tvbuff_t *tvb, int hf, proto_tree* ti);
128 /* Subdissector functions */
129 static void dissect_sdp_owner(tvbuff_t *tvb, proto_item* ti);
130 static void dissect_sdp_connection_info(tvbuff_t *tvb, proto_item* ti);
131 static void dissect_sdp_bandwidth(tvbuff_t *tvb, proto_item *ti);
132 static void dissect_sdp_time(tvbuff_t *tvb, proto_item* ti);
133 static void dissect_sdp_repeat_time(tvbuff_t *tvb, proto_item* ti);
134 static void dissect_sdp_timezone(tvbuff_t *tvb, proto_item* ti);
135 static void dissect_sdp_encryption_key(tvbuff_t *tvb, proto_item * ti);
136 static void dissect_sdp_session_attribute(tvbuff_t *tvb, proto_item *ti);
137 static void dissect_sdp_media(tvbuff_t *tvb, proto_item *ti);
138 static void dissect_sdp_media_attribute(tvbuff_t *tvb, proto_item *ti);
141 dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
143 proto_tree *sdp_tree;
144 proto_item *ti, *sub_ti;
148 gboolean in_media_description;
157 * As RFC 2327 says, "SDP is purely a format for session
158 * description - it does not incorporate a transport protocol,
159 * and is intended to use different transport protocols as
160 * appropriate including the Session Announcement Protocol,
161 * Session Initiation Protocol, Real-Time Streaming Protocol,
162 * electronic mail using the MIME extensions, and the
163 * Hypertext Transport Protocol."
165 * We therefore don't set the protocol or info columns;
166 * instead, we append to them, so that we don't erase
167 * what the protocol inside which the SDP stuff resides
170 if (check_col(pinfo->cinfo, COL_PROTOCOL))
171 col_append_str(pinfo->cinfo, COL_PROTOCOL, "/SDP");
173 if (check_col(pinfo->cinfo, COL_INFO)) {
174 /* XXX: Needs description. */
175 col_append_str(pinfo->cinfo, COL_INFO, ", with session description");
181 ti = proto_tree_add_item(tree, proto_sdp, tvb, offset, -1, FALSE);
182 sdp_tree = proto_item_add_subtree(ti, ett_sdp);
185 * Show the SDP message a line at a time.
187 in_media_description = FALSE;
188 while (tvb_offset_exists(tvb, offset)) {
190 * Find the end of the line.
192 linelen = tvb_find_line_end_unquoted(tvb, offset, -1,
196 * Line must contain at least e.g. "v=".
201 type = tvb_get_guint8(tvb,offset);
202 delim = tvb_get_guint8(tvb,offset + 1);
204 proto_tree_add_item(sdp_tree,hf_invalid,tvb, offset,
206 offset = next_offset;
215 hf = hf_protocol_version;
221 hf = hf_session_name;
224 if (in_media_description) {
228 hf = hf_session_info;
241 hf = hf_connection_info;
254 in_media_description = TRUE;
257 hf = hf_encryption_key;
260 if (in_media_description) {
261 hf = hf_media_attribute;
264 hf = hf_session_attribute;
275 if (hf == hf_unknown)
277 string = tvb_get_string(tvb, offset + tokenoffset,
278 linelen - tokenoffset);
279 sub_ti = proto_tree_add_string_format(sdp_tree,hf,tvb, offset,
282 proto_registrar_get_name(hf),
284 linelen - tokenoffset));
286 call_sdp_subdissector(tvb_new_subset(tvb,offset+tokenoffset,
287 linelen-tokenoffset,-1),
289 offset = next_offset;
292 datalen = tvb_length_remaining(tvb, offset);
294 proto_tree_add_text(sdp_tree, tvb, offset, datalen,
295 "Data (%d bytes)", datalen);
300 call_sdp_subdissector(tvbuff_t *tvb, int hf, proto_tree* ti){
302 dissect_sdp_owner(tvb,ti);
303 } else if ( hf == hf_connection_info) {
304 dissect_sdp_connection_info(tvb,ti);
305 } else if ( hf == hf_bandwidth) {
306 dissect_sdp_bandwidth(tvb,ti);
307 } else if ( hf == hf_time) {
308 dissect_sdp_time(tvb,ti);
309 } else if ( hf == hf_repeat_time ){
310 dissect_sdp_repeat_time(tvb,ti);
311 } else if ( hf == hf_timezone ) {
312 dissect_sdp_timezone(tvb,ti);
313 } else if ( hf == hf_encryption_key ) {
314 dissect_sdp_encryption_key(tvb,ti);
315 } else if ( hf == hf_session_attribute ){
316 dissect_sdp_session_attribute(tvb,ti);
317 } else if ( hf == hf_media ) {
318 dissect_sdp_media(tvb,ti);
319 } else if ( hf == hf_media_attribute ){
320 dissect_sdp_media_attribute(tvb,ti);
325 dissect_sdp_owner(tvbuff_t *tvb, proto_item *ti){
326 proto_tree *sdp_owner_tree;
327 gint offset,next_offset,tokenlen;
333 sdp_owner_tree = proto_item_add_subtree(ti,ett_sdp_owner);
335 /* Find the username */
336 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
337 if( next_offset == -1 )
339 tokenlen = next_offset - offset;
341 proto_tree_add_item(sdp_owner_tree,hf_owner_username,tvb, offset,tokenlen,
343 offset = next_offset + 1;
345 /* Find the session id */
346 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
347 if( next_offset == -1 )
349 tokenlen = next_offset - offset;
351 proto_tree_add_item(sdp_owner_tree,hf_owner_sessionid, tvb,
352 offset,tokenlen,FALSE);
353 offset = next_offset + 1;
355 /* Find the version */
356 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
357 if( next_offset == -1 )
359 tokenlen = next_offset - offset;
361 proto_tree_add_item(sdp_owner_tree,hf_owner_version, tvb,
362 offset,tokenlen,FALSE);
363 offset = next_offset + 1;
365 /* Find the network type */
366 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
367 if( next_offset == -1 )
369 tokenlen = next_offset - offset;
371 proto_tree_add_item(sdp_owner_tree,hf_owner_network_type, tvb,
372 offset,tokenlen,FALSE);
373 offset = next_offset + 1;
375 /* Find the address type */
376 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
377 if( next_offset == -1 )
379 tokenlen = next_offset - offset;
381 proto_tree_add_item(sdp_owner_tree,hf_owner_address_type, tvb,
382 offset,tokenlen,FALSE);
383 offset = next_offset + 1;
385 /* Find the address */
386 proto_tree_add_item(sdp_owner_tree,hf_owner_address, tvb, offset, -1, FALSE);
390 dissect_sdp_connection_info(tvbuff_t *tvb, proto_item* ti){
391 proto_tree *sdp_connection_info_tree;
392 gint offset,next_offset,tokenlen;
398 sdp_connection_info_tree = proto_item_add_subtree(ti,
399 ett_sdp_connection_info);
401 /* Find the network type */
402 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
403 if( next_offset == -1 )
405 tokenlen = next_offset - offset;
407 proto_tree_add_item(sdp_connection_info_tree,
408 hf_connection_info_network_type,tvb,
409 offset,tokenlen,FALSE);
410 offset = next_offset + 1;
412 /* Find the address type */
413 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
414 if( next_offset == -1 )
416 tokenlen = next_offset - offset;
418 proto_tree_add_item(sdp_connection_info_tree,
419 hf_connection_info_address_type,tvb,
420 offset,tokenlen,FALSE);
421 offset = next_offset + 1;
423 /* Find the connection address */
424 next_offset = tvb_find_guint8(tvb,offset,-1,'/');
425 if( next_offset == -1){
426 tokenlen = -1; /* end of tvbuff */
428 tokenlen = next_offset - offset;
430 proto_tree_add_item(sdp_connection_info_tree,
431 hf_connection_info_connection_address, tvb,
432 offset,tokenlen,FALSE);
433 if(next_offset != -1){
434 offset = next_offset + 1;
435 next_offset = tvb_find_guint8(tvb,offset,-1,'/');
436 if( next_offset == -1){
437 tokenlen = -1; /* end of tvbuff */
439 tokenlen = next_offset - offset;
441 proto_tree_add_item(sdp_connection_info_tree,
442 hf_connection_info_ttl,tvb,offset,tokenlen,FALSE);
443 if(next_offset != -1){
444 offset = next_offset + 1;
445 proto_tree_add_item(sdp_connection_info_tree,
446 hf_connection_info_num_addr, tvb,
453 dissect_sdp_bandwidth(tvbuff_t *tvb, proto_item *ti){
454 proto_tree * sdp_bandwidth_tree;
455 gint offset, next_offset, tokenlen;
461 sdp_bandwidth_tree = proto_item_add_subtree(ti,ett_sdp_bandwidth);
463 /* find the modifier */
464 next_offset = tvb_find_guint8(tvb,offset,-1,':');
466 if( next_offset == -1)
469 tokenlen = next_offset - offset;
471 proto_tree_add_item(sdp_bandwidth_tree, hf_bandwidth_modifier,
472 tvb, offset, tokenlen, FALSE);
474 offset = next_offset + 1;
476 proto_tree_add_item(sdp_bandwidth_tree, hf_bandwidth_value,
477 tvb, offset, -1, FALSE);
481 static void dissect_sdp_time(tvbuff_t *tvb, proto_item* ti){
482 proto_tree *sdp_time_tree;
483 gint offset,next_offset, tokenlen;
489 sdp_time_tree = proto_item_add_subtree(ti,ett_sdp_time);
492 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
493 if( next_offset == -1 )
496 tokenlen = next_offset - offset;
497 proto_tree_add_item(sdp_time_tree, hf_time_start, tvb,
498 offset, tokenlen, FALSE);
501 offset = next_offset + 1;
502 proto_tree_add_item(sdp_time_tree,hf_time_start, tvb,
506 static void dissect_sdp_repeat_time(tvbuff_t *tvb, proto_item* ti){
507 proto_tree *sdp_repeat_time_tree;
508 gint offset,next_offset, tokenlen;
514 sdp_repeat_time_tree = proto_item_add_subtree(ti,ett_sdp_time);
517 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
518 if( next_offset == -1 )
521 tokenlen = next_offset - offset;
522 proto_tree_add_item(sdp_repeat_time_tree, hf_repeat_time_interval, tvb,
523 offset, tokenlen, FALSE);
526 offset = next_offset + 1;
527 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
528 if( next_offset == -1 )
531 tokenlen = next_offset - offset;
532 proto_tree_add_item(sdp_repeat_time_tree,hf_repeat_time_duration, tvb,
533 offset, tokenlen, FALSE);
537 offset = next_offset +1;
538 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
539 if(next_offset != -1){
540 tokenlen = next_offset - offset;
542 tokenlen = -1; /* end of tvbuff */
544 proto_tree_add_item(sdp_repeat_time_tree, hf_repeat_time_offset,
545 tvb, offset, tokenlen, FALSE);
546 } while( next_offset != -1 );
550 dissect_sdp_timezone(tvbuff_t *tvb, proto_item* ti){
551 proto_tree* sdp_timezone_tree;
552 gint offset, next_offset, tokenlen;
557 sdp_timezone_tree = proto_item_add_subtree(ti,ett_sdp_timezone);
560 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
561 if(next_offset == -1)
563 tokenlen = next_offset - offset;
565 proto_tree_add_item(sdp_timezone_tree,hf_timezone_time,tvb,
566 offset, tokenlen, FALSE);
567 offset = next_offset + 1;
568 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
569 if(next_offset != -1){
570 tokenlen = next_offset - offset;
572 tokenlen = -1; /* end of tvbuff */
574 proto_tree_add_item(sdp_timezone_tree,hf_timezone_offset,tvb,
575 offset, tokenlen, FALSE);
576 offset = next_offset + 1;
577 } while (next_offset != -1);
582 static void dissect_sdp_encryption_key(tvbuff_t *tvb, proto_item * ti){
583 proto_tree *sdp_encryption_key_tree;
584 gint offset, next_offset, tokenlen;
590 sdp_encryption_key_tree = proto_item_add_subtree(ti,ett_sdp_encryption_key);
592 next_offset = tvb_find_guint8(tvb,offset,-1,':');
594 if(next_offset == -1)
597 tokenlen = next_offset - offset;
599 proto_tree_add_item(sdp_encryption_key_tree,hf_encryption_key_type,
600 tvb, offset, tokenlen, FALSE);
602 offset = next_offset + 1;
603 proto_tree_add_item(sdp_encryption_key_tree,hf_encryption_key_data,
604 tvb, offset, -1, FALSE);
610 static void dissect_sdp_session_attribute(tvbuff_t *tvb, proto_item * ti){
611 proto_tree *sdp_session_attribute_tree;
612 gint offset, next_offset, tokenlen;
618 sdp_session_attribute_tree = proto_item_add_subtree(ti,
619 ett_sdp_session_attribute);
621 next_offset = tvb_find_guint8(tvb,offset,-1,':');
623 if(next_offset == -1)
626 tokenlen = next_offset - offset;
628 proto_tree_add_item(sdp_session_attribute_tree,
629 hf_session_attribute_field,
630 tvb, offset, tokenlen, FALSE);
632 offset = next_offset + 1;
633 proto_tree_add_item(sdp_session_attribute_tree,
634 hf_session_attribute_value,
635 tvb, offset, -1, FALSE);
640 dissect_sdp_media(tvbuff_t *tvb, proto_item *ti){
641 proto_tree *sdp_media_tree;
642 gint offset, next_offset, tokenlen;
648 sdp_media_tree = proto_item_add_subtree(ti,ett_sdp_media);
650 next_offset = tvb_find_guint8(tvb,offset, -1, ' ');
652 if(next_offset == -1)
655 tokenlen = next_offset - offset;
657 proto_tree_add_item(sdp_media_tree, hf_media_media, tvb,
658 offset, tokenlen, FALSE);
660 offset = next_offset + 1;
662 next_offset = tvb_find_guint8(tvb,offset, -1, ' ');
663 if(next_offset == -1)
665 tokenlen = next_offset - offset;
666 next_offset = tvb_find_guint8(tvb,offset, tokenlen, '/');
668 if(next_offset != -1){
669 tokenlen = next_offset - offset;
671 proto_tree_add_item(sdp_media_tree, hf_media_port, tvb,
672 offset, tokenlen, FALSE);
673 offset = next_offset + 1;
674 next_offset = tvb_find_guint8(tvb,offset, -1, ' ');
675 if(next_offset == -1)
677 tokenlen = next_offset - offset;
678 proto_tree_add_item(sdp_media_tree, hf_media_portcount, tvb,
679 offset, tokenlen, FALSE);
680 offset = next_offset + 1;
682 next_offset = tvb_find_guint8(tvb,offset, -1, ' ');
684 if(next_offset == -1)
686 tokenlen = next_offset - offset;
688 proto_tree_add_item(sdp_media_tree, hf_media_port, tvb,
689 offset, tokenlen, FALSE);
690 offset = next_offset + 1;
693 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
695 if( next_offset == -1)
698 tokenlen = next_offset - offset;
700 proto_tree_add_item(sdp_media_tree, hf_media_proto, tvb,
701 offset, tokenlen, FALSE);
704 offset = next_offset + 1;
705 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
707 if(next_offset == -1){
708 tokenlen = -1; /* End of tvbuff */
710 tokenlen = next_offset - offset;
713 proto_tree_add_item(sdp_media_tree, hf_media_format, tvb,
714 offset, tokenlen, FALSE);
715 } while (next_offset != -1);
719 static void dissect_sdp_media_attribute(tvbuff_t *tvb, proto_item * ti){
720 proto_tree *sdp_media_attribute_tree;
721 gint offset, next_offset, tokenlen;
727 sdp_media_attribute_tree = proto_item_add_subtree(ti,
728 ett_sdp_media_attribute);
730 next_offset = tvb_find_guint8(tvb,offset,-1,':');
732 if(next_offset == -1)
735 tokenlen = next_offset - offset;
737 proto_tree_add_item(sdp_media_attribute_tree,
738 hf_media_attribute_field,
739 tvb, offset, tokenlen, FALSE);
741 offset = next_offset + 1;
742 proto_tree_add_item(sdp_media_attribute_tree,
743 hf_media_attribute_value,
744 tvb, offset, -1, FALSE);
749 proto_register_sdp(void)
751 static hf_register_info hf[] = {
752 { &hf_protocol_version,
753 { "Session Description Protocol Version (v)",
754 "sdp.version", FT_STRING, BASE_NONE,NULL,0x0,
755 "Session Description Protocol Version", HFILL }},
757 { "Owner/Creator, Session Id (o)",
758 "sdp.owner", FT_STRING, BASE_NONE, NULL, 0x0,
759 "Owner/Creator, Session Id", HFILL}},
761 { "Session Name (s)",
762 "sdp.session_name", FT_STRING, BASE_NONE,NULL, 0x0,
763 "Session Name", HFILL }},
765 { "Session Information (i)",
766 "sdp.session_info", FT_STRING, BASE_NONE, NULL, 0x0,
767 "Session Information", HFILL }},
769 { "URI of Description (u)",
770 "sdp.uri", FT_STRING, BASE_NONE,NULL, 0x0,
771 "URI of Description", HFILL }},
773 { "E-mail Address (e)",
774 "sdp.email", FT_STRING, BASE_NONE, NULL, 0x0,
775 "E-mail Address", HFILL }},
777 { "Phone Number (p)",
778 "sdp.phone", FT_STRING, BASE_NONE, NULL, 0x0,
779 "Phone Number", HFILL }},
780 { &hf_connection_info,
781 { "Connection Information (c)",
782 "sdp.connection_info", FT_STRING, BASE_NONE, NULL, 0x0,
783 "Connection Information", HFILL }},
785 { "Bandwidth Information (b)",
786 "sdp.bandwidth", FT_STRING, BASE_NONE, NULL, 0x0,
787 "Bandwidth Information", HFILL }},
789 { "Time Zone Adjustments (z)",
790 "sdp.timezone", FT_STRING, BASE_NONE, NULL, 0x0,
791 "Time Zone Adjustments", HFILL }},
792 { &hf_encryption_key,
793 { "Encryption Key (k)",
794 "sdp.encryption_key", FT_STRING, BASE_NONE, NULL, 0x0,
795 "Encryption Key", HFILL }},
796 { &hf_session_attribute,
797 { "Session Attribute (a)",
798 "sdp.session_attr", FT_STRING, BASE_NONE, NULL, 0x0,
799 "Session Attribute", HFILL }},
800 { &hf_media_attribute,
801 { "Media Attribute (a)",
802 "sdp.media_attr", FT_STRING, BASE_NONE, NULL, 0x0,
803 "Media Attribute", HFILL }},
805 { "Time Description, active time (t)",
806 "sdp.time", FT_STRING, BASE_NONE, NULL, 0x0,
807 "Time Description, active time", HFILL }},
810 "sdp.repeat_time", FT_STRING, BASE_NONE, NULL, 0x0,
811 "Repeat Time", HFILL }},
813 { "Media Description, name and address (m)",
814 "sdp.media", FT_STRING, BASE_NONE, NULL, 0x0,
815 "Media Description, name and address", HFILL }},
818 "sdp.media_title",FT_STRING, BASE_NONE, NULL, 0x0,
819 "Media Title", HFILL }},
822 "sdp.unknown",FT_STRING, BASE_NONE, NULL, 0x0,
826 "sdp.invalid",FT_STRING, BASE_NONE, NULL, 0x0,
827 "Invalid line", HFILL }},
828 { &hf_owner_username,
830 "sdp.owner.username",FT_STRING, BASE_NONE, NULL, 0x0,
831 "Owner Username", HFILL }},
832 { &hf_owner_sessionid,
834 "sdp.owner.sessionid",FT_STRING, BASE_NONE, NULL, 0x0,
835 "Session ID", HFILL }},
838 "sdp.owner.version",FT_STRING, BASE_NONE, NULL, 0x0,
839 "Session Version", HFILL }},
840 { &hf_owner_network_type,
841 { "Owner Network Type",
842 "sdp.owner.network_type",FT_STRING, BASE_NONE, NULL, 0x0,
843 "Owner Network Type", HFILL }},
844 { &hf_owner_address_type,
845 { "Owner Address Type",
846 "sdp.owner.address_type",FT_STRING, BASE_NONE, NULL, 0x0,
847 "Owner Address Type", HFILL }},
850 "sdp.owner.address",FT_STRING, BASE_NONE, NULL, 0x0,
851 "Owner Address", HFILL }},
852 { &hf_connection_info_network_type,
853 { "Connection Network Type",
854 "sdp.connection_info.network_type",FT_STRING, BASE_NONE, NULL, 0x0,
855 "Connection Network Type", HFILL }},
856 { &hf_connection_info_address_type,
857 { "Connection Address Type",
858 "sdp.connection_info.address_type",FT_STRING, BASE_NONE, NULL, 0x0,
859 "Connection Address Type", HFILL }},
860 { &hf_connection_info_connection_address,
861 { "Connection Address",
862 "sdp.connection_info.address",FT_STRING, BASE_NONE, NULL, 0x0,
863 "Connection Address", HFILL }},
864 { &hf_connection_info_ttl,
866 "sdp.connection_info.ttl",FT_STRING, BASE_NONE, NULL, 0x0,
867 "Connection TTL", HFILL }},
868 { &hf_connection_info_num_addr,
869 { "Connection Number of Addresses",
870 "sdp.connection_info.num_addr",FT_STRING, BASE_NONE, NULL, 0x0,
871 "Connection Number of Addresses", HFILL }},
872 { &hf_bandwidth_modifier,
873 { "Bandwidth Modifier",
874 "sdp.bandwidth.modifier",FT_STRING, BASE_NONE, NULL, 0x0,
875 "Bandwidth Modifier", HFILL }},
876 { &hf_bandwidth_value,
878 "sdp.bandwidth.value",FT_STRING, BASE_NONE, NULL, 0x0,
879 "Bandwidth Value", HFILL }},
881 { "Session Start Time",
882 "sdp.time.start",FT_STRING, BASE_NONE, NULL, 0x0,
883 "Session Start Time", HFILL }},
885 { "Session Stop Time",
886 "sdp.time.stop",FT_STRING, BASE_NONE, NULL, 0x0,
887 "Session Stop Time", HFILL }},
888 { &hf_repeat_time_interval,
890 "sdp.repeat_time.interval",FT_STRING, BASE_NONE, NULL, 0x0,
891 "Repeat Interval", HFILL }},
892 { &hf_repeat_time_duration,
894 "sdp.repeat_time.duration",FT_STRING, BASE_NONE, NULL, 0x0,
895 "Repeat Duration", HFILL }},
896 { &hf_repeat_time_offset,
898 "sdp.repeat_time.offset",FT_STRING, BASE_NONE, NULL, 0x0,
899 "Repeat Offset", HFILL }},
902 "sdp.timezone.time",FT_STRING, BASE_NONE, NULL, 0x0,
903 "Timezone Time", HFILL }},
904 { &hf_timezone_offset,
906 "sdp.timezone.offset",FT_STRING, BASE_NONE, NULL, 0x0,
907 "Timezone Offset", HFILL }},
908 { &hf_encryption_key_type,
910 "sdp.encryption_key.type",FT_STRING, BASE_NONE, NULL, 0x0,
912 { &hf_encryption_key_data,
914 "sdp.encryption_key.data",FT_STRING, BASE_NONE, NULL, 0x0,
916 { &hf_session_attribute_field,
917 { "Session Attribute Fieldname",
918 "sdp.session_attr.field",FT_STRING, BASE_NONE, NULL, 0x0,
919 "Session Attribute Fieldname", HFILL }},
920 { &hf_session_attribute_value,
921 { "Session Attribute Value",
922 "sdp.session_attr.value",FT_STRING, BASE_NONE, NULL, 0x0,
923 "Session Attribute Value", HFILL }},
926 "sdp.media.media",FT_STRING, BASE_NONE, NULL, 0x0,
927 "Media Type", HFILL }},
930 "sdp.media.port",FT_STRING, BASE_NONE, NULL, 0x0,
931 "Media Port", HFILL }},
932 { &hf_media_portcount,
933 { "Media Port Count",
934 "sdp.media.portcount",FT_STRING, BASE_NONE, NULL, 0x0,
935 "Media Port Count", HFILL }},
938 "sdp.media.proto",FT_STRING, BASE_NONE, NULL, 0x0,
939 "Media Proto", HFILL }},
942 "sdp.media.format",FT_STRING, BASE_NONE, NULL, 0x0,
943 "Media Format", HFILL }},
944 { &hf_media_attribute_field,
945 { "Media Attribute Fieldname",
946 "sdp.media_attribute.field",FT_STRING, BASE_NONE, NULL, 0x0,
947 "Media Attribute Fieldname", HFILL }},
948 { &hf_media_attribute_value,
949 { "Media Attribute Value",
950 "sdp.media_attribute.value",FT_STRING, BASE_NONE, NULL, 0x0,
951 "Media Attribute Value", HFILL }},
954 static gint *ett[] = {
957 &ett_sdp_connection_info,
960 &ett_sdp_repeat_time,
962 &ett_sdp_encryption_key,
963 &ett_sdp_session_attribute,
965 &ett_sdp_media_attribute,
968 proto_sdp = proto_register_protocol("Session Description Protocol",
970 proto_register_field_array(proto_sdp, hf, array_length(hf));
971 proto_register_subtree_array(ett, array_length(ett));
974 * Register the dissector by name, so other dissectors can
975 * grab it by name rather than just referring to it directly
976 * (you can't refer to it directly from a plugin dissector
977 * on Windows without stuffing it into the Big Transfer Vector).
979 register_dissector("sdp", dissect_sdp, proto_sdp);