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.30 2002/04/14 23:22:22 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.
30 #ifdef HAVE_SYS_TYPES_H
31 #include <sys/types.h>
38 #include <epan/packet.h>
39 #include <epan/strutil.h>
41 static int proto_sdp = -1;
43 /* Top level fields */
44 static int hf_protocol_version = -1;
45 static int hf_owner = -1;
46 static int hf_session_name = -1;
47 static int hf_session_info = -1;
48 static int hf_uri = -1;
49 static int hf_email = -1;
50 static int hf_phone = -1;
51 static int hf_connection_info = -1;
52 static int hf_bandwidth = -1;
53 static int hf_timezone = -1;
54 static int hf_encryption_key = -1;
55 static int hf_session_attribute = -1;
56 static int hf_media_attribute = -1;
57 static int hf_time = -1;
58 static int hf_repeat_time = -1;
59 static int hf_media = -1;
60 static int hf_media_title = -1;
61 static int hf_unknown = -1;
62 static int hf_misplaced = -1;
63 static int hf_invalid = -1;
65 /* hf_owner subfields*/
66 static int hf_owner_username = -1;
67 static int hf_owner_sessionid = -1;
68 static int hf_owner_version = -1;
69 static int hf_owner_network_type = -1;
70 static int hf_owner_address_type = -1;
71 static int hf_owner_address = -1;
73 /* hf_connection_info subfields */
74 static int hf_connection_info_network_type = -1;
75 static int hf_connection_info_address_type = -1;
76 static int hf_connection_info_connection_address = -1;
77 static int hf_connection_info_ttl = -1;
78 static int hf_connection_info_num_addr = -1;
80 /* hf_bandwidth subfields */
81 static int hf_bandwidth_modifier = -1;
82 static int hf_bandwidth_value = -1;
84 /* hf_time subfields */
85 static int hf_time_start = -1;
86 static int hf_time_stop = -1;
88 /* hf_repeat_time subfield */
89 static int hf_repeat_time_interval = -1;
90 static int hf_repeat_time_duration = -1;
91 static int hf_repeat_time_offset = -1;
93 /* hf_timezone subfields */
94 static int hf_timezone_time = -1;
95 static int hf_timezone_offset = -1;
97 /* hf_encryption_key subfields */
98 static int hf_encryption_key_type = -1;
99 static int hf_encryption_key_data = -1;
101 /* hf_session_attribute subfields */
102 static int hf_session_attribute_field = -1;
103 static int hf_session_attribute_value = -1;
105 /* hf_media subfields */
106 static int hf_media_media = -1;
107 static int hf_media_port = -1;
108 static int hf_media_portcount = -1;
109 static int hf_media_proto = -1;
110 static int hf_media_format = -1;
112 /* hf_session_attribute subfields */
113 static int hf_media_attribute_field = -1;
114 static int hf_media_attribute_value = -1;
117 static int ett_sdp = -1;
118 static int ett_sdp_owner = -1;
119 static int ett_sdp_connection_info = -1;
120 static int ett_sdp_bandwidth = -1;
121 static int ett_sdp_time = -1;
122 static int ett_sdp_repeat_time = -1;
123 static int ett_sdp_timezone = -1;
124 static int ett_sdp_encryption_key = -1;
125 static int ett_sdp_session_attribute = -1;
126 static int ett_sdp_media = -1;
127 static int ett_sdp_media_attribute = -1;
129 /* static functions */
131 static void call_sdp_subdissector(tvbuff_t *tvb, int hf, proto_tree* ti);
133 /* Subdissector functions */
134 static void dissect_sdp_owner(tvbuff_t *tvb, proto_item* ti);
135 static void dissect_sdp_connection_info(tvbuff_t *tvb, proto_item* ti);
136 static void dissect_sdp_bandwidth(tvbuff_t *tvb, proto_item *ti);
137 static void dissect_sdp_time(tvbuff_t *tvb, proto_item* ti);
138 static void dissect_sdp_repeat_time(tvbuff_t *tvb, proto_item* ti);
139 static void dissect_sdp_timezone(tvbuff_t *tvb, proto_item* ti);
140 static void dissect_sdp_encryption_key(tvbuff_t *tvb, proto_item * ti);
141 static void dissect_sdp_session_attribute(tvbuff_t *tvb, proto_item *ti);
142 static void dissect_sdp_media(tvbuff_t *tvb, proto_item *ti);
143 static void dissect_sdp_media_attribute(tvbuff_t *tvb, proto_item *ti);
146 dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
148 proto_tree *sdp_tree;
149 proto_item *ti, *sub_ti;
162 * As RFC 2327 says, "SDP is purely a format for session
163 * description - it does not incorporate a transport protocol,
164 * and is intended to use different transport protocols as
165 * appropriate including the Session Announcement Protocol,
166 * Session Initiation Protocol, Real-Time Streaming Protocol,
167 * electronic mail using the MIME extensions, and the
168 * Hypertext Transport Protocol."
170 * We therefore don't set the protocol or info columns;
171 * instead, we append to them, so that we don't erase
172 * what the protocol inside which the SDP stuff resides
175 if (check_col(pinfo->cinfo, COL_PROTOCOL))
176 col_append_str(pinfo->cinfo, COL_PROTOCOL, "/SDP");
178 if (check_col(pinfo->cinfo, COL_INFO)) {
179 /* XXX: Needs description. */
180 col_append_str(pinfo->cinfo, COL_INFO, ", with session description");
186 ti = proto_tree_add_item(tree, proto_sdp, tvb, offset, -1, FALSE);
187 sdp_tree = proto_item_add_subtree(ti, ett_sdp);
190 * Show the SDP message a line at a time.
193 while (tvb_offset_exists(tvb, offset)) {
195 * Find the end of the line.
197 linelen = tvb_find_line_end_unquoted(tvb, offset, -1,
201 * Line must contain at least e.g. "v=".
206 type = tvb_get_guint8(tvb,offset);
207 delim = tvb_get_guint8(tvb,offset + 1);
209 proto_tree_add_item(sdp_tree,hf_invalid,tvb, offset,
211 offset = next_offset;
220 hf = hf_protocol_version;
227 hf = hf_session_name;
231 hf = hf_session_info;
233 else if (section == 'm'){
250 hf = hf_connection_info;
267 hf = hf_encryption_key;
271 hf = hf_session_attribute;
273 else if (section == 'm'){
274 hf = hf_media_attribute;
288 if( hf == hf_unknown || hf == hf_misplaced )
290 string = g_malloc(linelen - tokenoffset + 1);
291 CLEANUP_PUSH(g_free, string);
292 tvb_memcpy(tvb, (guint8 *)string, offset + tokenoffset,
293 linelen - tokenoffset);
294 string[linelen - tokenoffset] = '\0';
295 sub_ti = proto_tree_add_string_format(sdp_tree,hf,tvb, offset,
298 proto_registrar_get_name(hf),
300 linelen - tokenoffset));
301 CLEANUP_CALL_AND_POP;
302 call_sdp_subdissector(tvb_new_subset(tvb,offset+tokenoffset,
303 linelen-tokenoffset,-1),
305 offset = next_offset;
308 datalen = tvb_length_remaining(tvb, offset);
310 proto_tree_add_text(sdp_tree, tvb, offset, datalen,
311 "Data (%d bytes)", datalen);
316 call_sdp_subdissector(tvbuff_t *tvb, int hf, proto_tree* ti){
318 dissect_sdp_owner(tvb,ti);
319 } else if ( hf == hf_connection_info) {
320 dissect_sdp_connection_info(tvb,ti);
321 } else if ( hf == hf_bandwidth) {
322 dissect_sdp_bandwidth(tvb,ti);
323 } else if ( hf == hf_time) {
324 dissect_sdp_time(tvb,ti);
325 } else if ( hf == hf_repeat_time ){
326 dissect_sdp_repeat_time(tvb,ti);
327 } else if ( hf == hf_timezone ) {
328 dissect_sdp_timezone(tvb,ti);
329 } else if ( hf == hf_encryption_key ) {
330 dissect_sdp_encryption_key(tvb,ti);
331 } else if ( hf == hf_session_attribute ){
332 dissect_sdp_session_attribute(tvb,ti);
333 } else if ( hf == hf_media ) {
334 dissect_sdp_media(tvb,ti);
335 } else if ( hf == hf_media_attribute ){
336 dissect_sdp_media_attribute(tvb,ti);
341 dissect_sdp_owner(tvbuff_t *tvb, proto_item *ti){
342 proto_tree *sdp_owner_tree;
343 gint offset,next_offset,tokenlen;
349 sdp_owner_tree = proto_item_add_subtree(ti,ett_sdp_owner);
351 /* Find the username */
352 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
353 if( next_offset == -1 )
355 tokenlen = next_offset - offset;
357 proto_tree_add_item(sdp_owner_tree,hf_owner_username,tvb, offset,tokenlen,
359 offset = next_offset + 1;
361 /* Find the session id */
362 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
363 if( next_offset == -1 )
365 tokenlen = next_offset - offset;
367 proto_tree_add_item(sdp_owner_tree,hf_owner_sessionid, tvb,
368 offset,tokenlen,FALSE);
369 offset = next_offset + 1;
371 /* Find the version */
372 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
373 if( next_offset == -1 )
375 tokenlen = next_offset - offset;
377 proto_tree_add_item(sdp_owner_tree,hf_owner_version, tvb,
378 offset,tokenlen,FALSE);
379 offset = next_offset + 1;
381 /* Find the network type */
382 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
383 if( next_offset == -1 )
385 tokenlen = next_offset - offset;
387 proto_tree_add_item(sdp_owner_tree,hf_owner_network_type, tvb,
388 offset,tokenlen,FALSE);
389 offset = next_offset + 1;
391 /* Find the address type */
392 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
393 if( next_offset == -1 )
395 tokenlen = next_offset - offset;
397 proto_tree_add_item(sdp_owner_tree,hf_owner_address_type, tvb,
398 offset,tokenlen,FALSE);
399 offset = next_offset + 1;
401 /* Find the address */
402 proto_tree_add_item(sdp_owner_tree,hf_owner_address, tvb, offset, -1, FALSE);
406 dissect_sdp_connection_info(tvbuff_t *tvb, proto_item* ti){
407 proto_tree *sdp_connection_info_tree;
408 gint offset,next_offset,tokenlen;
414 sdp_connection_info_tree = proto_item_add_subtree(ti,
415 ett_sdp_connection_info);
417 /* Find the network type */
418 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
419 if( next_offset == -1 )
421 tokenlen = next_offset - offset;
423 proto_tree_add_item(sdp_connection_info_tree,
424 hf_connection_info_network_type,tvb,
425 offset,tokenlen,FALSE);
426 offset = next_offset + 1;
428 /* Find the address type */
429 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
430 if( next_offset == -1 )
432 tokenlen = next_offset - offset;
434 proto_tree_add_item(sdp_connection_info_tree,
435 hf_connection_info_address_type,tvb,
436 offset,tokenlen,FALSE);
437 offset = next_offset + 1;
439 /* Find the connection address */
440 next_offset = tvb_find_guint8(tvb,offset,-1,'/');
441 if( next_offset == -1){
442 tokenlen = -1; /* end of tvbuff */
444 tokenlen = next_offset - offset;
446 proto_tree_add_item(sdp_connection_info_tree,
447 hf_connection_info_connection_address, tvb,
448 offset,tokenlen,FALSE);
449 if(next_offset != -1){
450 offset = next_offset + 1;
451 next_offset = tvb_find_guint8(tvb,offset,-1,'/');
452 if( next_offset == -1){
453 tokenlen = -1; /* end of tvbuff */
455 tokenlen = next_offset - offset;
457 proto_tree_add_item(sdp_connection_info_tree,
458 hf_connection_info_ttl,tvb,offset,tokenlen,FALSE);
459 if(next_offset != -1){
460 offset = next_offset + 1;
461 proto_tree_add_item(sdp_connection_info_tree,
462 hf_connection_info_num_addr, tvb,
469 dissect_sdp_bandwidth(tvbuff_t *tvb, proto_item *ti){
470 proto_tree * sdp_bandwidth_tree;
471 gint offset, next_offset, tokenlen;
477 sdp_bandwidth_tree = proto_item_add_subtree(ti,ett_sdp_bandwidth);
479 /* find the modifier */
480 next_offset = tvb_find_guint8(tvb,offset,-1,':');
482 if( next_offset == -1)
485 tokenlen = next_offset - offset;
487 proto_tree_add_item(sdp_bandwidth_tree, hf_bandwidth_modifier,
488 tvb, offset, tokenlen, FALSE);
490 offset = next_offset + 1;
492 proto_tree_add_item(sdp_bandwidth_tree, hf_bandwidth_value,
493 tvb, offset, -1, FALSE);
497 static void dissect_sdp_time(tvbuff_t *tvb, proto_item* ti){
498 proto_tree *sdp_time_tree;
499 gint offset,next_offset, tokenlen;
505 sdp_time_tree = proto_item_add_subtree(ti,ett_sdp_time);
508 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
509 if( next_offset == -1 )
512 tokenlen = next_offset - offset;
513 proto_tree_add_item(sdp_time_tree, hf_time_start, tvb,
514 offset, tokenlen, FALSE);
517 offset = next_offset + 1;
518 proto_tree_add_item(sdp_time_tree,hf_time_start, tvb,
522 static void dissect_sdp_repeat_time(tvbuff_t *tvb, proto_item* ti){
523 proto_tree *sdp_repeat_time_tree;
524 gint offset,next_offset, tokenlen;
530 sdp_repeat_time_tree = proto_item_add_subtree(ti,ett_sdp_time);
533 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
534 if( next_offset == -1 )
537 tokenlen = next_offset - offset;
538 proto_tree_add_item(sdp_repeat_time_tree, hf_repeat_time_interval, tvb,
539 offset, tokenlen, FALSE);
542 offset = next_offset + 1;
543 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
544 if( next_offset == -1 )
547 tokenlen = next_offset - offset;
548 proto_tree_add_item(sdp_repeat_time_tree,hf_repeat_time_duration, tvb,
549 offset, tokenlen, FALSE);
553 offset = next_offset +1;
554 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
555 if(next_offset != -1){
556 tokenlen = next_offset - offset;
558 tokenlen = -1; /* end of tvbuff */
560 proto_tree_add_item(sdp_repeat_time_tree, hf_repeat_time_offset,
561 tvb, offset, tokenlen, FALSE);
562 } while( next_offset != -1 );
566 dissect_sdp_timezone(tvbuff_t *tvb, proto_item* ti){
567 proto_tree* sdp_timezone_tree;
568 gint offset, next_offset, tokenlen;
573 sdp_timezone_tree = proto_item_add_subtree(ti,ett_sdp_timezone);
576 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
577 if(next_offset == -1)
579 tokenlen = next_offset - offset;
581 proto_tree_add_item(sdp_timezone_tree,hf_timezone_time,tvb,
582 offset, tokenlen, FALSE);
583 offset = next_offset + 1;
584 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
585 if(next_offset != -1){
586 tokenlen = next_offset - offset;
588 tokenlen = -1; /* end of tvbuff */
590 proto_tree_add_item(sdp_timezone_tree,hf_timezone_offset,tvb,
591 offset, tokenlen, FALSE);
592 offset = next_offset + 1;
593 } while (next_offset != -1);
598 static void dissect_sdp_encryption_key(tvbuff_t *tvb, proto_item * ti){
599 proto_tree *sdp_encryption_key_tree;
600 gint offset, next_offset, tokenlen;
606 sdp_encryption_key_tree = proto_item_add_subtree(ti,ett_sdp_encryption_key);
608 next_offset = tvb_find_guint8(tvb,offset,-1,':');
610 if(next_offset == -1)
613 tokenlen = next_offset - offset;
615 proto_tree_add_item(sdp_encryption_key_tree,hf_encryption_key_type,
616 tvb, offset, tokenlen, FALSE);
618 offset = next_offset + 1;
619 proto_tree_add_item(sdp_encryption_key_tree,hf_encryption_key_data,
620 tvb, offset, -1, FALSE);
626 static void dissect_sdp_session_attribute(tvbuff_t *tvb, proto_item * ti){
627 proto_tree *sdp_session_attribute_tree;
628 gint offset, next_offset, tokenlen;
634 sdp_session_attribute_tree = proto_item_add_subtree(ti,
635 ett_sdp_session_attribute);
637 next_offset = tvb_find_guint8(tvb,offset,-1,':');
639 if(next_offset == -1)
642 tokenlen = next_offset - offset;
644 proto_tree_add_item(sdp_session_attribute_tree,
645 hf_session_attribute_field,
646 tvb, offset, tokenlen, FALSE);
648 offset = next_offset + 1;
649 proto_tree_add_item(sdp_session_attribute_tree,
650 hf_session_attribute_value,
651 tvb, offset, -1, FALSE);
656 dissect_sdp_media(tvbuff_t *tvb, proto_item *ti){
657 proto_tree *sdp_media_tree;
658 gint offset, next_offset, tokenlen;
664 sdp_media_tree = proto_item_add_subtree(ti,ett_sdp_media);
666 next_offset = tvb_find_guint8(tvb,offset, -1, ' ');
668 if(next_offset == -1)
671 tokenlen = next_offset - offset;
673 proto_tree_add_item(sdp_media_tree, hf_media_media, tvb,
674 offset, tokenlen, FALSE);
676 offset = next_offset + 1;
678 next_offset = tvb_find_guint8(tvb,offset, -1, ' ');
679 if(next_offset == -1)
681 tokenlen = next_offset - offset;
682 next_offset = tvb_find_guint8(tvb,offset, tokenlen, '/');
684 if(next_offset != -1){
685 tokenlen = next_offset - offset;
687 proto_tree_add_item(sdp_media_tree, hf_media_port, tvb,
688 offset, tokenlen, FALSE);
689 offset = next_offset + 1;
690 next_offset = tvb_find_guint8(tvb,offset, -1, ' ');
691 if(next_offset == -1)
693 tokenlen = next_offset - offset;
694 proto_tree_add_item(sdp_media_tree, hf_media_portcount, tvb,
695 offset, tokenlen, FALSE);
696 offset = next_offset + 1;
698 next_offset = tvb_find_guint8(tvb,offset, -1, ' ');
700 if(next_offset == -1)
702 tokenlen = next_offset - offset;
704 proto_tree_add_item(sdp_media_tree, hf_media_port, tvb,
705 offset, tokenlen, FALSE);
706 offset = next_offset + 1;
709 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
711 if( next_offset == -1)
714 tokenlen = next_offset - offset;
716 proto_tree_add_item(sdp_media_tree, hf_media_proto, tvb,
717 offset, tokenlen, FALSE);
720 offset = next_offset + 1;
721 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
723 if(next_offset == -1){
724 tokenlen = -1; /* End of tvbuff */
726 tokenlen = next_offset - offset;
729 proto_tree_add_item(sdp_media_tree, hf_media_format, tvb,
730 offset, tokenlen, FALSE);
731 } while (next_offset != -1);
735 static void dissect_sdp_media_attribute(tvbuff_t *tvb, proto_item * ti){
736 proto_tree *sdp_media_attribute_tree;
737 gint offset, next_offset, tokenlen;
743 sdp_media_attribute_tree = proto_item_add_subtree(ti,
744 ett_sdp_media_attribute);
746 next_offset = tvb_find_guint8(tvb,offset,-1,':');
748 if(next_offset == -1)
751 tokenlen = next_offset - offset;
753 proto_tree_add_item(sdp_media_attribute_tree,
754 hf_media_attribute_field,
755 tvb, offset, tokenlen, FALSE);
757 offset = next_offset + 1;
758 proto_tree_add_item(sdp_media_attribute_tree,
759 hf_media_attribute_value,
760 tvb, offset, -1, FALSE);
765 proto_register_sdp(void)
767 static hf_register_info hf[] = {
768 { &hf_protocol_version,
769 { "Session Description Protocol Version (v)",
770 "sdp.version", FT_STRING, BASE_NONE,NULL,0x0,
771 "Session Description Protocol Version", HFILL }},
773 { "Owner/Creator, Session Id (o)",
774 "sdp.owner", FT_STRING, BASE_NONE, NULL, 0x0,
775 "Owner/Creator, Session Id", HFILL}},
777 { "Session Name (s)",
778 "sdp.session_name", FT_STRING, BASE_NONE,NULL, 0x0,
779 "Session Name", HFILL }},
781 { "Session Information (i)",
782 "sdp.session_info", FT_STRING, BASE_NONE, NULL, 0x0,
783 "Session Information", HFILL }},
785 { "URI of Description (u)",
786 "sdp.uri", FT_STRING, BASE_NONE,NULL, 0x0,
787 "URI of Description", HFILL }},
789 { "E-mail Address (e)",
790 "sdp.email", FT_STRING, BASE_NONE, NULL, 0x0,
791 "E-mail Address", HFILL }},
793 { "Phone Number (p)",
794 "sdp.phone", FT_STRING, BASE_NONE, NULL, 0x0,
795 "Phone Number", HFILL }},
796 { &hf_connection_info,
797 { "Connection Information (c)",
798 "sdp.connection_info", FT_STRING, BASE_NONE, NULL, 0x0,
799 "Connection Information", HFILL }},
801 { "Bandwidth Information (b)",
802 "sdp.bandwidth", FT_STRING, BASE_NONE, NULL, 0x0,
803 "Bandwidth Information", HFILL }},
805 { "Time Zone Adjustments (z)",
806 "sdp.timezone", FT_STRING, BASE_NONE, NULL, 0x0,
807 "Time Zone Adjustments", HFILL }},
808 { &hf_encryption_key,
809 { "Encryption Key (k)",
810 "sdp.encryption_key", FT_STRING, BASE_NONE, NULL, 0x0,
811 "Encryption Key", HFILL }},
812 { &hf_session_attribute,
813 { "Session Attribute (a)",
814 "sdp.session_attr", FT_STRING, BASE_NONE, NULL, 0x0,
815 "Session Attribute", HFILL }},
816 { &hf_media_attribute,
817 { "Media Attribute (a)",
818 "sdp.media_attr", FT_STRING, BASE_NONE, NULL, 0x0,
819 "Media Attribute", HFILL }},
821 { "Time Description, active time (t)",
822 "sdp.time", FT_STRING, BASE_NONE, NULL, 0x0,
823 "Time Description, active time", HFILL }},
826 "sdp.repeat_time", FT_STRING, BASE_NONE, NULL, 0x0,
827 "Repeat Time", HFILL }},
829 { "Media Description, name and address (m)",
830 "sdp.media", FT_STRING, BASE_NONE, NULL, 0x0,
831 "Media Description, name and address", HFILL }},
834 "sdp.media_title",FT_STRING, BASE_NONE, NULL, 0x0,
835 "Media Title", HFILL }},
838 "sdp.unknown",FT_STRING, BASE_NONE, NULL, 0x0,
842 "sdp.misplaced",FT_STRING, BASE_NONE, NULL, 0x0,
843 "Misplaced", HFILL }},
846 "sdp.invalid",FT_STRING, BASE_NONE, NULL, 0x0,
847 "Invalid line", HFILL }},
848 { &hf_owner_username,
850 "sdp.owner.username",FT_STRING, BASE_NONE, NULL, 0x0,
851 "Owner Username", HFILL }},
852 { &hf_owner_sessionid,
854 "sdp.owner.sessionid",FT_STRING, BASE_NONE, NULL, 0x0,
855 "Session ID", HFILL }},
858 "sdp.owner.version",FT_STRING, BASE_NONE, NULL, 0x0,
859 "Session Version", HFILL }},
860 { &hf_owner_network_type,
861 { "Owner Network Type",
862 "sdp.owner.network_type",FT_STRING, BASE_NONE, NULL, 0x0,
863 "Owner Network Type", HFILL }},
864 { &hf_owner_address_type,
865 { "Owner Address Type",
866 "sdp.owner.address_type",FT_STRING, BASE_NONE, NULL, 0x0,
867 "Owner Address Type", HFILL }},
870 "sdp.owner.address",FT_STRING, BASE_NONE, NULL, 0x0,
871 "Owner Address", HFILL }},
872 { &hf_connection_info_network_type,
873 { "Connection Network Type",
874 "sdp.connection_info.network_type",FT_STRING, BASE_NONE, NULL, 0x0,
875 "Connection Network Type", HFILL }},
876 { &hf_connection_info_address_type,
877 { "Connection Address Type",
878 "sdp.connection_info.address_type",FT_STRING, BASE_NONE, NULL, 0x0,
879 "Connection Address Type", HFILL }},
880 { &hf_connection_info_connection_address,
881 { "Connection Address",
882 "sdp.connection_info.address",FT_STRING, BASE_NONE, NULL, 0x0,
883 "Connection Address", HFILL }},
884 { &hf_connection_info_ttl,
886 "sdp.connection_info.ttl",FT_STRING, BASE_NONE, NULL, 0x0,
887 "Connection TTL", HFILL }},
888 { &hf_connection_info_num_addr,
889 { "Connection Number of Addresses",
890 "sdp.connection_info.num_addr",FT_STRING, BASE_NONE, NULL, 0x0,
891 "Connection Number of Addresses", HFILL }},
892 { &hf_bandwidth_modifier,
893 { "Bandwidth Modifier",
894 "sdp.bandwidth.modifier",FT_STRING, BASE_NONE, NULL, 0x0,
895 "Bandwidth Modifier", HFILL }},
896 { &hf_bandwidth_value,
898 "sdp.bandwidth.value",FT_STRING, BASE_NONE, NULL, 0x0,
899 "Bandwidth Value", HFILL }},
901 { "Session Start Time",
902 "sdp.time.start",FT_STRING, BASE_NONE, NULL, 0x0,
903 "Session Start Time", HFILL }},
905 { "Session Stop Time",
906 "sdp.time.stop",FT_STRING, BASE_NONE, NULL, 0x0,
907 "Session Stop Time", HFILL }},
908 { &hf_repeat_time_interval,
910 "sdp.repeat_time.interval",FT_STRING, BASE_NONE, NULL, 0x0,
911 "Repeat Interval", HFILL }},
912 { &hf_repeat_time_duration,
914 "sdp.repeat_time.duration",FT_STRING, BASE_NONE, NULL, 0x0,
915 "Repeat Duration", HFILL }},
916 { &hf_repeat_time_offset,
918 "sdp.repeat_time.offset",FT_STRING, BASE_NONE, NULL, 0x0,
919 "Repeat Offset", HFILL }},
922 "sdp.timezone.time",FT_STRING, BASE_NONE, NULL, 0x0,
923 "Timezone Time", HFILL }},
924 { &hf_timezone_offset,
926 "sdp.timezone.offset",FT_STRING, BASE_NONE, NULL, 0x0,
927 "Timezone Offset", HFILL }},
928 { &hf_encryption_key_type,
930 "sdp.encryption_key.type",FT_STRING, BASE_NONE, NULL, 0x0,
932 { &hf_encryption_key_data,
934 "sdp.encryption_key.data",FT_STRING, BASE_NONE, NULL, 0x0,
936 { &hf_session_attribute_field,
937 { "Session Attribute Fieldname",
938 "sdp.session_attr.field",FT_STRING, BASE_NONE, NULL, 0x0,
939 "Session Attribute Fieldname", HFILL }},
940 { &hf_session_attribute_value,
941 { "Session Attribute Value",
942 "sdp.session_attr.value",FT_STRING, BASE_NONE, NULL, 0x0,
943 "Session Attribute Value", HFILL }},
946 "sdp.media.media",FT_STRING, BASE_NONE, NULL, 0x0,
947 "Media Type", HFILL }},
950 "sdp.media.port",FT_STRING, BASE_NONE, NULL, 0x0,
951 "Media Port", HFILL }},
952 { &hf_media_portcount,
953 { "Media Port Count",
954 "sdp.media.portcount",FT_STRING, BASE_NONE, NULL, 0x0,
955 "Media Port Count", HFILL }},
958 "sdp.media.proto",FT_STRING, BASE_NONE, NULL, 0x0,
959 "Media Proto", HFILL }},
962 "sdp.media.format",FT_STRING, BASE_NONE, NULL, 0x0,
963 "Media Format", HFILL }},
964 { &hf_media_attribute_field,
965 { "Media Attribute Fieldname",
966 "sdp.media_attribute.field",FT_STRING, BASE_NONE, NULL, 0x0,
967 "Media Attribute Fieldname", HFILL }},
968 { &hf_media_attribute_value,
969 { "Media Attribute Value",
970 "sdp.media_attribute.value",FT_STRING, BASE_NONE, NULL, 0x0,
971 "Media Attribute Value", HFILL }},
974 static gint *ett[] = {
977 &ett_sdp_connection_info,
980 &ett_sdp_repeat_time,
982 &ett_sdp_encryption_key,
983 &ett_sdp_session_attribute,
985 &ett_sdp_media_attribute,
988 proto_sdp = proto_register_protocol("Session Description Protocol",
990 proto_register_field_array(proto_sdp, hf, array_length(hf));
991 proto_register_subtree_array(ett, array_length(ett));
994 * Register the dissector by name, so other dissectors can
995 * grab it by name rather than just referring to it directly
996 * (you can't refer to it directly from a plugin dissector
997 * on Windows without stuffing it into the Big Transfer Vector).
999 register_dissector("sdp", dissect_sdp, proto_sdp);