/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SDP_H
#define _SDP_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/* SDP Parse errors */
typedef struct sdp_list {
void *value;
} sdp_list_t;
/*
* SDP origin field.
* o=<username> <sess-id> <sess-version> <nettype> <addrtype> <unicast-address>
*/
typedef struct sdp_origin {
char *o_username;
char *o_nettype;
char *o_addrtype;
char *o_address;
} sdp_origin_t;
/*
* SDP connection field.
* c=<nettype> <addrtype> <connection-address>[/ttl]/<number of addresses>
*/
typedef struct sdp_conn {
char *c_nettype;
char *c_addrtype;
char *c_address;
int c_addrcount;
} sdp_conn_t;
/*
* SDP repeat field. Always found in time structure.
* r=<repeat interval> <active duration> <offsets from start-time>
*/
typedef struct sdp_repeat {
} sdp_repeat_t;
/*
* SDP time field.
* t=<start-time> <stop-time>
*/
typedef struct sdp_time {
} sdp_time_t;
/*
* SDP time zone field.
* z=<adjustment time> <offset> <adjustment time> <offset> ....
*/
typedef struct sdp_zone {
char *z_offset;
} sdp_zone_t;
/*
* SDP attribute field.
* a=<attribute> or a=<attribute>:<value>
*/
typedef struct sdp_attr {
char *a_name;
char *a_value;
} sdp_attr_t;
/*
* SDP bandwidth field.
* b=<bwtype>:<bandwidth>
*/
typedef struct sdp_bandwidth {
char *b_type;
/*
* SDP key field to session or media section of SDP.
* k=<method> or k=<method>:<encryption key>
*/
typedef struct sdp_key {
char *k_method;
char *k_enckey;
} sdp_key_t;
/*
* SDP media section, contains media fields and other fields within
* media section.
* m=<media> <port>[/portcount] <proto> <fmt> ...
*/
typedef struct sdp_media {
char *m_name;
int m_portcount;
char *m_proto;
char *m_info;
} sdp_media_t;
struct sdp_session {
int sdp_session_version;
int s_version;
char *s_name;
char *s_info;
char *s_uri;
};
extern int sdp_parse(const char *, int, int, sdp_session_t **,
uint_t *);
extern sdp_session_t *sdp_new_session();
uint64_t, const char *, const char *, const char *);
extern int sdp_add_name(sdp_session_t *, const char *);
extern int sdp_add_information(char **, const char *);
extern int sdp_add_uri(sdp_session_t *, const char *);
extern int sdp_add_email(sdp_session_t *, const char *);
extern int sdp_add_phone(sdp_session_t *, const char *);
extern int sdp_add_connection(sdp_conn_t **, const char *,
const char *, const char *, uint8_t, int);
extern int sdp_add_bandwidth(sdp_bandwidth_t **, const char *,
uint64_t);
const char *);
sdp_time_t **);
extern int sdp_add_key(sdp_key_t **, const char *, const char *);
extern int sdp_add_attribute(sdp_attr_t **, const char *,
const char *);
int, const char *, const char *, sdp_media_t **);
extern int sdp_delete_all_field(sdp_session_t *, const char);
extern int sdp_delete_all_media_field(sdp_media_t *, const char);
extern void sdp_free_session(sdp_session_t *);
extern char *sdp_session_to_str(const sdp_session_t *, int *);
#ifdef __cplusplus
}
#endif
#endif /* _SDP_H */