⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sdp.h

📁 this is simple sip stack.
💻 H
📖 第 1 页 / 共 2 页
字号:
/* * This file is part of the Sofia-SIP package * * Copyright (C) 2005 Nokia Corporation. * * Contact: Pekka Pessi <pekka.pessi@nokia.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */#ifndef SDP_H#define SDP_H/**@file sofia-sip/sdp.h  Simple SDP (RFC 2327) Interface. * * @author Pekka Pessi <Pekka.Pessi@nokia.com> * @author Kai Vehmanen <kai.vehmanen@nokia.com> * * @date Created: Fri Feb 18 08:54:48 2000 ppessi */#ifndef SU_ALLOC_H#include <sofia-sip/su_alloc.h>#endif#ifndef SU_TYPES_H#include <sofia-sip/su_types.h>#endifSOFIA_BEGIN_DECLS/** SDP session description */typedef struct sdp_session_s     sdp_session_t;/** SDP version "v=" line */typedef unsigned long            sdp_version_t;/** SDP origin "o=" line */typedef struct sdp_origin_s      sdp_origin_t;/** SDP connection "c=" line */typedef struct sdp_connection_s  sdp_connection_t;/** SDP bandwidth "b=" line */typedef struct sdp_bandwidth_s   sdp_bandwidth_t;/** SDP time "t=" line */typedef struct sdp_time_s        sdp_time_t;/** SDP repeat "r=" line */typedef struct sdp_repeat_s      sdp_repeat_t;/** SDP timezone "z=" line */typedef struct sdp_zone_s        sdp_zone_t;/** SDP encryption key "k=" line */typedef struct sdp_key_s         sdp_key_t;/** SDP attribute "a=" line */typedef struct sdp_attribute_s   sdp_attribute_t;/** SDP media "m=" line */typedef struct sdp_media_s       sdp_media_t;/** SDP list ("e=", "p=" lines) */typedef struct sdp_list_s        sdp_list_t;/** SDP rtpmap attribute */typedef struct sdp_rtpmap_s      sdp_rtpmap_t;/** Message text */typedef char const               sdp_text_t;#define SDP_MIME_TYPE "application/sdp"enum {  SDP_CURRENT_VERSION = 0};/** Session description */struct sdp_session_s{  int                sdp_size;		/**< sizeof sdp_session_t */  sdp_session_t     *sdp_next;	        /**< Next description in list */  sdp_version_t      sdp_version[1];	/**< SDP version */  sdp_origin_t      *sdp_origin;	/**< Owner/creator and session ID */  sdp_text_t        *sdp_subject;	/**< Session name */  sdp_text_t        *sdp_information;	/**< Session information  */  sdp_text_t        *sdp_uri;		/**< URi of description */  sdp_list_t   	    *sdp_emails;	/**< E-mail address(s) */  sdp_list_t   	    *sdp_phones;	/**< Phone number(s)  */  sdp_connection_t  *sdp_connection;	/**< Group (or member) address */  sdp_bandwidth_t   *sdp_bandwidths;	/**< Session bandwidth */  sdp_time_t        *sdp_time;		/**< Session active time */  sdp_key_t         *sdp_key;	        /**< Session key */  sdp_attribute_t   *sdp_attributes;    /**< Session attributes */  sdp_text_t        *sdp_charset;       /**< SDP charset (default is UTF8) */  sdp_media_t       *sdp_media;         /**< Media descriptors */};/** Session description identification */ struct sdp_origin_s{  int               o_size;		/**< sizeof sdp_origin_t */  sdp_text_t       *o_username;		/**< Username of originator */  uint64_t          o_id;		/**< Session identification  */  uint64_t          o_version;		/**< Version of session description */  sdp_connection_t *o_address;		/**< Address of originator */};/** Network type */typedef enum{  sdp_net_x = 0,			/**< Unknown network type */  sdp_net_in = 1		        /**< Internet */} sdp_nettype_e;/** Address type */typedef enum{  sdp_addr_x   = 0,			/**< Unknown address type */  sdp_addr_ip4 = 1,			/**< IPv4 address */  sdp_addr_ip6 = 2,			/**< IPv6 address */} sdp_addrtype_e;/** SDP connection - host or group address */struct sdp_connection_s{  int               c_size;		/**< Size fo sdp_connection_t */  sdp_connection_t *c_next;		/**< Next connection in list */  sdp_nettype_e     c_nettype;		/**< Network type */  sdp_addrtype_e    c_addrtype;		/**< Address type */  sdp_text_t       *c_address;		/**< Host or group address */  unsigned          c_ttl : 8;		/**< Time to live (scope) */  unsigned          c_mcast : 1;        /**< True if multicast */  unsigned : 0;  unsigned          c_groups;		/**< Number of groups (if multiple) */};/** Bandwdith type */typedef enum{  sdp_bw_x,				/**< Unknown bandwidth type */  sdp_bw_ct,				/**< Conference total */  sdp_bw_as,				/**< Application-specific */} sdp_bandwidth_e;/** Session or media bandwidth. */struct sdp_bandwidth_s{  int              b_size;		/**< Size fo sdp_bandwidth_t */  sdp_bandwidth_t *b_next;		/**< Next bw description in list */  sdp_bandwidth_e  b_modifier;		/**< Meaning of value 					     (total, or per application).  */  sdp_text_t      *b_modifier_name;     /**< Modifier if not well-known */  unsigned long    b_value;		/**< Bandwidth in kilobits per second */};/** Active time description. */struct sdp_time_s{  int            t_size;		/**< sizeof sdp_time_t in bytes */  sdp_time_t    *t_next;		/**< Next time description in list */  unsigned long  t_start;		/**< Start time (seconds since 1900) */  unsigned long  t_stop;		/**< Stop time (seconds since 1900) */  sdp_repeat_t  *t_repeat;		/**< Repeat information */  sdp_zone_t    *t_zone;		/**< Time Zone infromation */};/** Description of repetition. */struct sdp_repeat_s{  int           r_size;			/**< Size of structure including					 * r_offsets[r_number_of_offsets]					 */  int           r_number_of_offsets;	/**< Number of offsets in list */  unsigned long r_interval;		/**< Time between activations */  unsigned long r_duration;		/**< Duration of activation */  unsigned long r_offsets[1];	        /**< List of offsets from start-time */};/** Timezone */struct sdp_zone_s{  /** Size of structure including z_adjustments[z_number_of_adjustments] */  int z_size;  int z_number_of_adjustments;		/**< Number of adjustments in list  */  struct {    unsigned long z_at;			/**< Adjustment time  */    long          z_offset;		/**< Adjustment offset  */  } z_adjustments[1];		        /**< List of timezone adjustments */};/** Mechanism to be used to obtain session key */typedef enum {  sdp_key_x,				/**< Unknown mechanism */  sdp_key_clear,			/**< Key is included untransformed */  sdp_key_base64,			/**< Key is encoded with base64 */  sdp_key_uri,				/**< URI used to obtain a key */  sdp_key_prompt			/**< No key is included, 					     prompt user for key */} sdp_key_method_e;/** Session key */struct sdp_key_s{  int              k_size;		/**< sizeof sdp_key_t  */  sdp_key_method_e k_method;		/**< Mechanism used to obtain key */  sdp_text_t      *k_method_name;	/**< Mechanism if not known  */  sdp_text_t      *k_material;		/**< Encryption key  */};/** Session or media attribute */struct sdp_attribute_s {  int              a_size;		/**< sizeof sdp_attribute_t  */  sdp_attribute_t *a_next;		/**< Next attribute in list */  sdp_text_t      *a_name;		/**< Attribute name */  sdp_text_t      *a_value;		/**< Attribute value */};/** Media type @sa RFC2327 page 18. */typedef enum{  sdp_media_x = 0,			/**< Unknown media */  sdp_media_any,		        /**< * wildcard */  sdp_media_audio,			/**< Audio */  sdp_media_video,			/**< Video */  sdp_media_application,		/**< Conferencing */  sdp_media_data,			/**< Bulk data transfer */  sdp_media_control,			/**< Additional conference control */  sdp_media_message,			/**< Messaging sessions*/  sdp_media_image			/**< Image browsing sessions for JPIP */} sdp_media_e;/** Media transport protocol. */typedef enum{  sdp_proto_x = 0,			/**< Unknown transport  */  sdp_proto_tcp = 6,			/**< TCP  */  sdp_proto_udp = 17,			/**< Plain UDP */  sdp_proto_rtp = 256,			/**< RTP/AVP */  sdp_proto_srtp = 257,			/**< RTP/SAVP  */  sdp_proto_tls = 511,			/**< TLS over TCP */  sdp_proto_any = 512		        /**< * wildcard */} sdp_proto_e;/** Session mode. @note Identical to rtp_mode_t. */typedef enum {  sdp_inactive = 0,   sdp_sendonly = 1,   sdp_recvonly = 2,   sdp_sendrecv = sdp_sendonly | sdp_recvonly} sdp_mode_t;/** Media announcement. *  * This structure describes one media type, e.g., audio.  The description * contains the transport address (IP address and port) used for the group, * the transport protocol used, the media formats or RTP payload types, and * optionally media-specific bandwidth specification, encryption key and * attributes.  * * There is a pointer (m_user) for the application data, too. */struct sdp_media_s{  int               m_size;		/**< sizeof sdp_media_t  */  sdp_media_t      *m_next;		/**< Next media announcement  */  sdp_session_t    *m_session;          /**< Back-pointer to session level */  sdp_media_e       m_type;		/**< Media type  */  sdp_text_t       *m_type_name;	/**< Media type name */  unsigned long     m_port;		/**< Transport port number */  unsigned long     m_number_of_ports;	/**< Number of ports (if multiple) */  sdp_proto_e       m_proto;		/**< Transport protocol  */  sdp_text_t       *m_proto_name;	/**< Transport protocol name */  sdp_list_t       *m_format;		/**< List of media formats */  sdp_rtpmap_t     *m_rtpmaps;		/**< List of RTP maps */  sdp_text_t       *m_information;	/**< Media information */  sdp_connection_t *m_connections;	/**< List of addresses used */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -