1*5306Sgm209912 /* 2*5306Sgm209912 * CDDL HEADER START 3*5306Sgm209912 * 4*5306Sgm209912 * The contents of this file are subject to the terms of the 5*5306Sgm209912 * Common Development and Distribution License (the "License"). 6*5306Sgm209912 * You may not use this file except in compliance with the License. 7*5306Sgm209912 * 8*5306Sgm209912 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*5306Sgm209912 * or http://www.opensolaris.org/os/licensing. 10*5306Sgm209912 * See the License for the specific language governing permissions 11*5306Sgm209912 * and limitations under the License. 12*5306Sgm209912 * 13*5306Sgm209912 * When distributing Covered Code, include this CDDL HEADER in each 14*5306Sgm209912 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*5306Sgm209912 * If applicable, add the following below this CDDL HEADER, with the 16*5306Sgm209912 * fields enclosed by brackets "[]" replaced with your own identifying 17*5306Sgm209912 * information: Portions Copyright [yyyy] [name of copyright owner] 18*5306Sgm209912 * 19*5306Sgm209912 * CDDL HEADER END 20*5306Sgm209912 */ 21*5306Sgm209912 22*5306Sgm209912 /* 23*5306Sgm209912 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 24*5306Sgm209912 * Use is subject to license terms. 25*5306Sgm209912 */ 26*5306Sgm209912 27*5306Sgm209912 #ifndef _SDP_PARSE_H 28*5306Sgm209912 #define _SDP_PARSE_H 29*5306Sgm209912 30*5306Sgm209912 #pragma ident "%Z%%M% %I% %E% SMI" 31*5306Sgm209912 32*5306Sgm209912 #ifdef __cplusplus 33*5306Sgm209912 extern "C" { 34*5306Sgm209912 #endif 35*5306Sgm209912 36*5306Sgm209912 #include <sdp.h> 37*5306Sgm209912 #include <sys/types.h> 38*5306Sgm209912 39*5306Sgm209912 #define SDP_MEMORY_ERROR 0x10000000 40*5306Sgm209912 41*5306Sgm209912 #define SDP_VERSION_ORDER " " 42*5306Sgm209912 #define SDP_ORIGIN_ORDER "v" 43*5306Sgm209912 #define SDP_NAME_ORDER "o" 44*5306Sgm209912 #define SDP_INFO_ORDER "s" 45*5306Sgm209912 #define SDP_URI_ORDER "is" 46*5306Sgm209912 #define SDP_EMAIL_ORDER "euis" 47*5306Sgm209912 #define SDP_PHONE_ORDER "peuis" 48*5306Sgm209912 #define SDP_CONN_ORDER "peuis" 49*5306Sgm209912 #define SDP_BW_ORDER "bcpeuis" 50*5306Sgm209912 #define SDP_TIME_ORDER "tbcpeuis" 51*5306Sgm209912 #define SDP_REPEAT_ORDER "rt" 52*5306Sgm209912 #define SDP_ZONE_ORDER "rt" 53*5306Sgm209912 #define SDP_KEY_ORDER "zrt" 54*5306Sgm209912 #define SDP_ATTR_ORDER "akzrt" 55*5306Sgm209912 #define SDP_MEDIA_ORDER "makzrt" 56*5306Sgm209912 #define SDP_M_INFO_ORDER "m" 57*5306Sgm209912 #define SDP_M_CONN_ORDER "cim" 58*5306Sgm209912 #define SDP_M_BW_ORDER "bcim" 59*5306Sgm209912 #define SDP_M_KEY_ORDER "bcim" 60*5306Sgm209912 #define SDP_M_ATTR_ORDER "akbcim" 61*5306Sgm209912 62*5306Sgm209912 typedef struct sdp_description { 63*5306Sgm209912 /* 64*5306Sgm209912 * Following boolean fields are used to 65*5306Sgm209912 * check for presence of mandatory fields 66*5306Sgm209912 * in session structure 67*5306Sgm209912 */ 68*5306Sgm209912 boolean_t d_version; /* Version field */ 69*5306Sgm209912 boolean_t d_origin; /* Origin field */ 70*5306Sgm209912 boolean_t d_name; /* Name field */ 71*5306Sgm209912 boolean_t d_conn; /* Connection field */ 72*5306Sgm209912 boolean_t d_mconn; /* Media connection field */ 73*5306Sgm209912 boolean_t d_mparsed; /* Media parsed */ 74*5306Sgm209912 boolean_t d_tparsed; /* Time parsed */ 75*5306Sgm209912 /* 76*5306Sgm209912 * keeps count of connection fields within 77*5306Sgm209912 * media section 78*5306Sgm209912 */ 79*5306Sgm209912 int d_mccount; 80*5306Sgm209912 sdp_media_t *d_lmedia; /* Last media field */ 81*5306Sgm209912 sdp_time_t *d_ltime; /* Last time field */ 82*5306Sgm209912 uint_t d_perror; /* Parse error */ 83*5306Sgm209912 char d_prev; /* previous field */ 84*5306Sgm209912 char d_mprev; /* previous field in media section */ 85*5306Sgm209912 } sdp_description_t; 86*5306Sgm209912 87*5306Sgm209912 extern int add_value_to_list(sdp_list_t **, const char *, int, 88*5306Sgm209912 boolean_t); 89*5306Sgm209912 extern int sdp_list_to_str(sdp_list_t *, char **, boolean_t); 90*5306Sgm209912 extern int sdp_str_to_list(sdp_list_t **, const char *, int, 91*5306Sgm209912 boolean_t); 92*5306Sgm209912 extern void sdp_free_repeat(sdp_repeat_t *); 93*5306Sgm209912 extern void sdp_free_origin(sdp_origin_t *); 94*5306Sgm209912 extern void sdp_free_list(sdp_list_t *); 95*5306Sgm209912 extern void sdp_free_connection(sdp_conn_t *); 96*5306Sgm209912 extern void sdp_free_bandwidth(sdp_bandwidth_t *); 97*5306Sgm209912 extern void sdp_free_time(sdp_time_t *); 98*5306Sgm209912 extern void sdp_free_zone(sdp_zone_t *); 99*5306Sgm209912 extern void sdp_free_attribute(sdp_attr_t *); 100*5306Sgm209912 extern void sdp_free_key(sdp_key_t *); 101*5306Sgm209912 extern void sdp_free_media(sdp_media_t *); 102*5306Sgm209912 103*5306Sgm209912 #ifdef __cplusplus 104*5306Sgm209912 } 105*5306Sgm209912 #endif 106*5306Sgm209912 107*5306Sgm209912 #endif /* _SDP_PARSE_H */ 108