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.33 2002/08/28 21:00:30 jmayer 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 = g_malloc(linelen - tokenoffset + 1);
278 CLEANUP_PUSH(g_free, string);
279 tvb_memcpy(tvb, (guint8 *)string, offset + tokenoffset,
280 linelen - tokenoffset);
281 string[linelen - tokenoffset] = '\0';
282 sub_ti = proto_tree_add_string_format(sdp_tree,hf,tvb, offset,
285 proto_registrar_get_name(hf),
287 linelen - tokenoffset));
288 CLEANUP_CALL_AND_POP;
289 call_sdp_subdissector(tvb_new_subset(tvb,offset+tokenoffset,
290 linelen-tokenoffset,-1),
292 offset = next_offset;
295 datalen = tvb_length_remaining(tvb, offset);
297 proto_tree_add_text(sdp_tree, tvb, offset, datalen,
298 "Data (%d bytes)", datalen);
303 call_sdp_subdissector(tvbuff_t *tvb, int hf, proto_tree* ti){
305 dissect_sdp_owner(tvb,ti);
306 } else if ( hf == hf_connection_info) {
307 dissect_sdp_connection_info(tvb,ti);
308 } else if ( hf == hf_bandwidth) {
309 dissect_sdp_bandwidth(tvb,ti);
310 } else if ( hf == hf_time) {
311 dissect_sdp_time(tvb,ti);
312 } else if ( hf == hf_repeat_time ){
313 dissect_sdp_repeat_time(tvb,ti);
314 } else if ( hf == hf_timezone ) {
315 dissect_sdp_timezone(tvb,ti);
316 } else if ( hf == hf_encryption_key ) {
317 dissect_sdp_encryption_key(tvb,ti);
318 } else if ( hf == hf_session_attribute ){
319 dissect_sdp_session_attribute(tvb,ti);
320 } else if ( hf == hf_media ) {
321 dissect_sdp_media(tvb,ti);
322 } else if ( hf == hf_media_attribute ){
323 dissect_sdp_media_attribute(tvb,ti);
328 dissect_sdp_owner(tvbuff_t *tvb, proto_item *ti){
329 proto_tree *sdp_owner_tree;
330 gint offset,next_offset,tokenlen;
336 sdp_owner_tree = proto_item_add_subtree(ti,ett_sdp_owner);
338 /* Find the username */
339 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
340 if( next_offset == -1 )
342 tokenlen = next_offset - offset;
344 proto_tree_add_item(sdp_owner_tree,hf_owner_username,tvb, offset,tokenlen,
346 offset = next_offset + 1;
348 /* Find the session id */
349 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
350 if( next_offset == -1 )
352 tokenlen = next_offset - offset;
354 proto_tree_add_item(sdp_owner_tree,hf_owner_sessionid, tvb,
355 offset,tokenlen,FALSE);
356 offset = next_offset + 1;
358 /* Find the version */
359 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
360 if( next_offset == -1 )
362 tokenlen = next_offset - offset;
364 proto_tree_add_item(sdp_owner_tree,hf_owner_version, tvb,
365 offset,tokenlen,FALSE);
366 offset = next_offset + 1;
368 /* Find the network type */
369 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
370 if( next_offset == -1 )
372 tokenlen = next_offset - offset;
374 proto_tree_add_item(sdp_owner_tree,hf_owner_network_type, tvb,
375 offset,tokenlen,FALSE);
376 offset = next_offset + 1;
378 /* Find the address type */
379 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
380 if( next_offset == -1 )
382 tokenlen = next_offset - offset;
384 proto_tree_add_item(sdp_owner_tree,hf_owner_address_type, tvb,
385 offset,tokenlen,FALSE);
386 offset = next_offset + 1;
388 /* Find the address */
389 proto_tree_add_item(sdp_owner_tree,hf_owner_address, tvb, offset, -1, FALSE);
393 dissect_sdp_connection_info(tvbuff_t *tvb, proto_item* ti){
394 proto_tree *sdp_connection_info_tree;
395 gint offset,next_offset,tokenlen;
401 sdp_connection_info_tree = proto_item_add_subtree(ti,
402 ett_sdp_connection_info);
404 /* Find the network type */
405 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
406 if( next_offset == -1 )
408 tokenlen = next_offset - offset;
410 proto_tree_add_item(sdp_connection_info_tree,
411 hf_connection_info_network_type,tvb,
412 offset,tokenlen,FALSE);
413 offset = next_offset + 1;
415 /* Find the address type */
416 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
417 if( next_offset == -1 )
419 tokenlen = next_offset - offset;
421 proto_tree_add_item(sdp_connection_info_tree,
422 hf_connection_info_address_type,tvb,
423 offset,tokenlen,FALSE);
424 offset = next_offset + 1;
426 /* Find the connection address */
427 next_offset = tvb_find_guint8(tvb,offset,-1,'/');
428 if( next_offset == -1){
429 tokenlen = -1; /* end of tvbuff */
431 tokenlen = next_offset - offset;
433 proto_tree_add_item(sdp_connection_info_tree,
434 hf_connection_info_connection_address, tvb,
435 offset,tokenlen,FALSE);
436 if(next_offset != -1){
437 offset = next_offset + 1;
438 next_offset = tvb_find_guint8(tvb,offset,-1,'/');
439 if( next_offset == -1){
440 tokenlen = -1; /* end of tvbuff */
442 tokenlen = next_offset - offset;
444 proto_tree_add_item(sdp_connection_info_tree,
445 hf_connection_info_ttl,tvb,offset,tokenlen,FALSE);
446 if(next_offset != -1){
447 offset = next_offset + 1;
448 proto_tree_add_item(sdp_connection_info_tree,
449 hf_connection_info_num_addr, tvb,
456 dissect_sdp_bandwidth(tvbuff_t *tvb, proto_item *ti){
457 proto_tree * sdp_bandwidth_tree;
458 gint offset, next_offset, tokenlen;
464 sdp_bandwidth_tree = proto_item_add_subtree(ti,ett_sdp_bandwidth);
466 /* find the modifier */
467 next_offset = tvb_find_guint8(tvb,offset,-1,':');
469 if( next_offset == -1)
472 tokenlen = next_offset - offset;
474 proto_tree_add_item(sdp_bandwidth_tree, hf_bandwidth_modifier,
475 tvb, offset, tokenlen, FALSE);
477 offset = next_offset + 1;
479 proto_tree_add_item(sdp_bandwidth_tree, hf_bandwidth_value,
480 tvb, offset, -1, FALSE);
484 static void dissect_sdp_time(tvbuff_t *tvb, proto_item* ti){
485 proto_tree *sdp_time_tree;
486 gint offset,next_offset, tokenlen;
492 sdp_time_tree = proto_item_add_subtree(ti,ett_sdp_time);
495 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
496 if( next_offset == -1 )
499 tokenlen = next_offset - offset;
500 proto_tree_add_item(sdp_time_tree, hf_time_start, tvb,
501 offset, tokenlen, FALSE);
504 offset = next_offset + 1;
505 proto_tree_add_item(sdp_time_tree,hf_time_start, tvb,
509 static void dissect_sdp_repeat_time(tvbuff_t *tvb, proto_item* ti){
510 proto_tree *sdp_repeat_time_tree;
511 gint offset,next_offset, tokenlen;
517 sdp_repeat_time_tree = proto_item_add_subtree(ti,ett_sdp_time);
520 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
521 if( next_offset == -1 )
524 tokenlen = next_offset - offset;
525 proto_tree_add_item(sdp_repeat_time_tree, hf_repeat_time_interval, tvb,
526 offset, tokenlen, FALSE);
529 offset = next_offset + 1;
530 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
531 if( next_offset == -1 )
534 tokenlen = next_offset - offset;
535 proto_tree_add_item(sdp_repeat_time_tree,hf_repeat_time_duration, tvb,
536 offset, tokenlen, FALSE);
540 offset = next_offset +1;
541 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
542 if(next_offset != -1){
543 tokenlen = next_offset - offset;
545 tokenlen = -1; /* end of tvbuff */
547 proto_tree_add_item(sdp_repeat_time_tree, hf_repeat_time_offset,
548 tvb, offset, tokenlen, FALSE);
549 } while( next_offset != -1 );
553 dissect_sdp_timezone(tvbuff_t *tvb, proto_item* ti){
554 proto_tree* sdp_timezone_tree;
555 gint offset, next_offset, tokenlen;
560 sdp_timezone_tree = proto_item_add_subtree(ti,ett_sdp_timezone);
563 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
564 if(next_offset == -1)
566 tokenlen = next_offset - offset;
568 proto_tree_add_item(sdp_timezone_tree,hf_timezone_time,tvb,
569 offset, tokenlen, FALSE);
570 offset = next_offset + 1;
571 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
572 if(next_offset != -1){
573 tokenlen = next_offset - offset;
575 tokenlen = -1; /* end of tvbuff */
577 proto_tree_add_item(sdp_timezone_tree,hf_timezone_offset,tvb,
578 offset, tokenlen, FALSE);
579 offset = next_offset + 1;
580 } while (next_offset != -1);
585 static void dissect_sdp_encryption_key(tvbuff_t *tvb, proto_item * ti){
586 proto_tree *sdp_encryption_key_tree;
587 gint offset, next_offset, tokenlen;
593 sdp_encryption_key_tree = proto_item_add_subtree(ti,ett_sdp_encryption_key);
595 next_offset = tvb_find_guint8(tvb,offset,-1,':');
597 if(next_offset == -1)
600 tokenlen = next_offset - offset;
602 proto_tree_add_item(sdp_encryption_key_tree,hf_encryption_key_type,
603 tvb, offset, tokenlen, FALSE);
605 offset = next_offset + 1;
606 proto_tree_add_item(sdp_encryption_key_tree,hf_encryption_key_data,
607 tvb, offset, -1, FALSE);
613 static void dissect_sdp_session_attribute(tvbuff_t *tvb, proto_item * ti){
614 proto_tree *sdp_session_attribute_tree;
615 gint offset, next_offset, tokenlen;
621 sdp_session_attribute_tree = proto_item_add_subtree(ti,
622 ett_sdp_session_attribute);
624 next_offset = tvb_find_guint8(tvb,offset,-1,':');
626 if(next_offset == -1)
629 tokenlen = next_offset - offset;
631 proto_tree_add_item(sdp_session_attribute_tree,
632 hf_session_attribute_field,
633 tvb, offset, tokenlen, FALSE);
635 offset = next_offset + 1;
636 proto_tree_add_item(sdp_session_attribute_tree,
637 hf_session_attribute_value,
638 tvb, offset, -1, FALSE);
643 dissect_sdp_media(tvbuff_t *tvb, proto_item *ti){
644 proto_tree *sdp_media_tree;
645 gint offset, next_offset, tokenlen;
651 sdp_media_tree = proto_item_add_subtree(ti,ett_sdp_media);
653 next_offset = tvb_find_guint8(tvb,offset, -1, ' ');
655 if(next_offset == -1)
658 tokenlen = next_offset - offset;
660 proto_tree_add_item(sdp_media_tree, hf_media_media, tvb,
661 offset, tokenlen, FALSE);
663 offset = next_offset + 1;
665 next_offset = tvb_find_guint8(tvb,offset, -1, ' ');
666 if(next_offset == -1)
668 tokenlen = next_offset - offset;
669 next_offset = tvb_find_guint8(tvb,offset, tokenlen, '/');
671 if(next_offset != -1){
672 tokenlen = next_offset - offset;
674 proto_tree_add_item(sdp_media_tree, hf_media_port, tvb,
675 offset, tokenlen, FALSE);
676 offset = next_offset + 1;
677 next_offset = tvb_find_guint8(tvb,offset, -1, ' ');
678 if(next_offset == -1)
680 tokenlen = next_offset - offset;
681 proto_tree_add_item(sdp_media_tree, hf_media_portcount, tvb,
682 offset, tokenlen, FALSE);
683 offset = next_offset + 1;
685 next_offset = tvb_find_guint8(tvb,offset, -1, ' ');
687 if(next_offset == -1)
689 tokenlen = next_offset - offset;
691 proto_tree_add_item(sdp_media_tree, hf_media_port, tvb,
692 offset, tokenlen, FALSE);
693 offset = next_offset + 1;
696 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
698 if( next_offset == -1)
701 tokenlen = next_offset - offset;
703 proto_tree_add_item(sdp_media_tree, hf_media_proto, tvb,
704 offset, tokenlen, FALSE);
707 offset = next_offset + 1;
708 next_offset = tvb_find_guint8(tvb,offset,-1,' ');
710 if(next_offset == -1){
711 tokenlen = -1; /* End of tvbuff */
713 tokenlen = next_offset - offset;
716 proto_tree_add_item(sdp_media_tree, hf_media_format, tvb,
717 offset, tokenlen, FALSE);
718 } while (next_offset != -1);
722 static void dissect_sdp_media_attribute(tvbuff_t *tvb, proto_item * ti){
723 proto_tree *sdp_media_attribute_tree;
724 gint offset, next_offset, tokenlen;
730 sdp_media_attribute_tree = proto_item_add_subtree(ti,
731 ett_sdp_media_attribute);
733 next_offset = tvb_find_guint8(tvb,offset,-1,':');
735 if(next_offset == -1)
738 tokenlen = next_offset - offset;
740 proto_tree_add_item(sdp_media_attribute_tree,
741 hf_media_attribute_field,
742 tvb, offset, tokenlen, FALSE);
744 offset = next_offset + 1;
745 proto_tree_add_item(sdp_media_attribute_tree,
746 hf_media_attribute_value,
747 tvb, offset, -1, FALSE);
752 proto_register_sdp(void)
754 static hf_register_info hf[] = {
755 { &hf_protocol_version,
756 { "Session Description Protocol Version (v)",
757 "sdp.version", FT_STRING, BASE_NONE,NULL,0x0,
758 "Session Description Protocol Version", HFILL }},
760 { "Owner/Creator, Session Id (o)",
761 "sdp.owner", FT_STRING, BASE_NONE, NULL, 0x0,
762 "Owner/Creator, Session Id", HFILL}},
764 { "Session Name (s)",
765 "sdp.session_name", FT_STRING, BASE_NONE,NULL, 0x0,
766 "Session Name", HFILL }},
768 { "Session Information (i)",
769 "sdp.session_info", FT_STRING, BASE_NONE, NULL, 0x0,
770 "Session Information", HFILL }},
772 { "URI of Description (u)",
773 "sdp.uri", FT_STRING, BASE_NONE,NULL, 0x0,
774 "URI of Description", HFILL }},
776 { "E-mail Address (e)",
777 "sdp.email", FT_STRING, BASE_NONE, NULL, 0x0,
778 "E-mail Address", HFILL }},
780 { "Phone Number (p)",
781 "sdp.phone", FT_STRING, BASE_NONE, NULL, 0x0,
782 "Phone Number", HFILL }},
783 { &hf_connection_info,
784 { "Connection Information (c)",
785 "sdp.connection_info", FT_STRING, BASE_NONE, NULL, 0x0,
786 "Connection Information", HFILL }},
788 { "Bandwidth Information (b)",
789 "sdp.bandwidth", FT_STRING, BASE_NONE, NULL, 0x0,
790 "Bandwidth Information", HFILL }},
792 { "Time Zone Adjustments (z)",
793 "sdp.timezone", FT_STRING, BASE_NONE, NULL, 0x0,
794 "Time Zone Adjustments", HFILL }},
795 { &hf_encryption_key,
796 { "Encryption Key (k)",
797 "sdp.encryption_key", FT_STRING, BASE_NONE, NULL, 0x0,
798 "Encryption Key", HFILL }},
799 { &hf_session_attribute,
800 { "Session Attribute (a)",
801 "sdp.session_attr", FT_STRING, BASE_NONE, NULL, 0x0,
802 "Session Attribute", HFILL }},
803 { &hf_media_attribute,
804 { "Media Attribute (a)",
805 "sdp.media_attr", FT_STRING, BASE_NONE, NULL, 0x0,
806 "Media Attribute", HFILL }},
808 { "Time Description, active time (t)",
809 "sdp.time", FT_STRING, BASE_NONE, NULL, 0x0,
810 "Time Description, active time", HFILL }},
813 "sdp.repeat_time", FT_STRING, BASE_NONE, NULL, 0x0,
814 "Repeat Time", HFILL }},
816 { "Media Description, name and address (m)",
817 "sdp.media", FT_STRING, BASE_NONE, NULL, 0x0,
818 "Media Description, name and address", HFILL }},
821 "sdp.media_title",FT_STRING, BASE_NONE, NULL, 0x0,
822 "Media Title", HFILL }},
825 "sdp.unknown",FT_STRING, BASE_NONE, NULL, 0x0,
829 "sdp.invalid",FT_STRING, BASE_NONE, NULL, 0x0,
830 "Invalid line", HFILL }},
831 { &hf_owner_username,
833 "sdp.owner.username",FT_STRING, BASE_NONE, NULL, 0x0,
834 "Owner Username", HFILL }},
835 { &hf_owner_sessionid,
837 "sdp.owner.sessionid",FT_STRING, BASE_NONE, NULL, 0x0,
838 "Session ID", HFILL }},
841 "sdp.owner.version",FT_STRING, BASE_NONE, NULL, 0x0,
842 "Session Version", HFILL }},
843 { &hf_owner_network_type,
844 { "Owner Network Type",
845 "sdp.owner.network_type",FT_STRING, BASE_NONE, NULL, 0x0,
846 "Owner Network Type", HFILL }},
847 { &hf_owner_address_type,
848 { "Owner Address Type",
849 "sdp.owner.address_type",FT_STRING, BASE_NONE, NULL, 0x0,
850 "Owner Address Type", HFILL }},
853 "sdp.owner.address",FT_STRING, BASE_NONE, NULL, 0x0,
854 "Owner Address", HFILL }},
855 { &hf_connection_info_network_type,
856 { "Connection Network Type",
857 "sdp.connection_info.network_type",FT_STRING, BASE_NONE, NULL, 0x0,
858 "Connection Network Type", HFILL }},
859 { &hf_connection_info_address_type,
860 { "Connection Address Type",
861 "sdp.connection_info.address_type",FT_STRING, BASE_NONE, NULL, 0x0,
862 "Connection Address Type", HFILL }},
863 { &hf_connection_info_connection_address,
864 { "Connection Address",
865 "sdp.connection_info.address",FT_STRING, BASE_NONE, NULL, 0x0,
866 "Connection Address", HFILL }},
867 { &hf_connection_info_ttl,
869 "sdp.connection_info.ttl",FT_STRING, BASE_NONE, NULL, 0x0,
870 "Connection TTL", HFILL }},
871 { &hf_connection_info_num_addr,
872 { "Connection Number of Addresses",
873 "sdp.connection_info.num_addr",FT_STRING, BASE_NONE, NULL, 0x0,
874 "Connection Number of Addresses", HFILL }},
875 { &hf_bandwidth_modifier,
876 { "Bandwidth Modifier",
877 "sdp.bandwidth.modifier",FT_STRING, BASE_NONE, NULL, 0x0,
878 "Bandwidth Modifier", HFILL }},
879 { &hf_bandwidth_value,
881 "sdp.bandwidth.value",FT_STRING, BASE_NONE, NULL, 0x0,
882 "Bandwidth Value", HFILL }},
884 { "Session Start Time",
885 "sdp.time.start",FT_STRING, BASE_NONE, NULL, 0x0,
886 "Session Start Time", HFILL }},
888 { "Session Stop Time",
889 "sdp.time.stop",FT_STRING, BASE_NONE, NULL, 0x0,
890 "Session Stop Time", HFILL }},
891 { &hf_repeat_time_interval,
893 "sdp.repeat_time.interval",FT_STRING, BASE_NONE, NULL, 0x0,
894 "Repeat Interval", HFILL }},
895 { &hf_repeat_time_duration,
897 "sdp.repeat_time.duration",FT_STRING, BASE_NONE, NULL, 0x0,
898 "Repeat Duration", HFILL }},
899 { &hf_repeat_time_offset,
901 "sdp.repeat_time.offset",FT_STRING, BASE_NONE, NULL, 0x0,
902 "Repeat Offset", HFILL }},
905 "sdp.timezone.time",FT_STRING, BASE_NONE, NULL, 0x0,
906 "Timezone Time", HFILL }},
907 { &hf_timezone_offset,
909 "sdp.timezone.offset",FT_STRING, BASE_NONE, NULL, 0x0,
910 "Timezone Offset", HFILL }},
911 { &hf_encryption_key_type,
913 "sdp.encryption_key.type",FT_STRING, BASE_NONE, NULL, 0x0,
915 { &hf_encryption_key_data,
917 "sdp.encryption_key.data",FT_STRING, BASE_NONE, NULL, 0x0,
919 { &hf_session_attribute_field,
920 { "Session Attribute Fieldname",
921 "sdp.session_attr.field",FT_STRING, BASE_NONE, NULL, 0x0,
922 "Session Attribute Fieldname", HFILL }},
923 { &hf_session_attribute_value,
924 { "Session Attribute Value",
925 "sdp.session_attr.value",FT_STRING, BASE_NONE, NULL, 0x0,
926 "Session Attribute Value", HFILL }},
929 "sdp.media.media",FT_STRING, BASE_NONE, NULL, 0x0,
930 "Media Type", HFILL }},
933 "sdp.media.port",FT_STRING, BASE_NONE, NULL, 0x0,
934 "Media Port", HFILL }},
935 { &hf_media_portcount,
936 { "Media Port Count",
937 "sdp.media.portcount",FT_STRING, BASE_NONE, NULL, 0x0,
938 "Media Port Count", HFILL }},
941 "sdp.media.proto",FT_STRING, BASE_NONE, NULL, 0x0,
942 "Media Proto", HFILL }},
945 "sdp.media.format",FT_STRING, BASE_NONE, NULL, 0x0,
946 "Media Format", HFILL }},
947 { &hf_media_attribute_field,
948 { "Media Attribute Fieldname",
949 "sdp.media_attribute.field",FT_STRING, BASE_NONE, NULL, 0x0,
950 "Media Attribute Fieldname", HFILL }},
951 { &hf_media_attribute_value,
952 { "Media Attribute Value",
953 "sdp.media_attribute.value",FT_STRING, BASE_NONE, NULL, 0x0,
954 "Media Attribute Value", HFILL }},
957 static gint *ett[] = {
960 &ett_sdp_connection_info,
963 &ett_sdp_repeat_time,
965 &ett_sdp_encryption_key,
966 &ett_sdp_session_attribute,
968 &ett_sdp_media_attribute,
971 proto_sdp = proto_register_protocol("Session Description Protocol",
973 proto_register_field_array(proto_sdp, hf, array_length(hf));
974 proto_register_subtree_array(ett, array_length(ett));
977 * Register the dissector by name, so other dissectors can
978 * grab it by name rather than just referring to it directly
979 * (you can't refer to it directly from a plugin dissector
980 * on Windows without stuffing it into the Big Transfer Vector).
982 register_dissector("sdp", dissect_sdp, proto_sdp);