JavaScript is required to for searching.
跳过导航链接
退出打印视图
编程接口指南     Oracle Solaris 10 1/13 Information Library (简体中文)
search filter icon
search icon

文档信息

前言

1.  内存和 CPU 管理

2.  用于 Solaris Cluster 的远程共享内存 API

3.  会话描述协议 API

会话描述 API 概述

SDP 库函数

创建 SDP 会话结构

创建新的 SDP 会话结构

向 SDP 会话结构添加源字段

向 SDP 会话结构添加名称字段

向 SDP 会话结构添加信息字段

向 SDP 会话结构添加 URI 字段

向 SDP 会话结构添加电子邮件字段

向 SDP 会话结构添加电话字段

向 SDP 会话结构添加连接字段

向 SDP 会话结构添加带宽字段

向 SDP 会话结构添加时间字段

向 SDP 会话结构添加重复字段

向 SDP 会话结构添加区域字段

向 SDP 会话结构添加密钥字段

向 SDP 会话结构添加属性字段

向 SDP 会话结构添加介质字段

代码样例:构建 SDP 会话结构

搜索 SDP 会话结构

在 SDP 会话结构中查找属性

在 SDP 会话结构中查找介质

在 SDP 会话结构中查找介质格式

关闭 SDP 会话结构

从 SDP 会话结构中删除字段

从 SDP 介质结构中删除字段

从 SDP 介质结构中删除介质

从 SDP 介质结构中删除属性

从 SDP 介质结构中删除属性

SDP API 实用程序函数

解析 SDP 会话结构

克隆现有的 SDP 会话结构

将 SDP 会话结构转换为字符串

4.  进程调度程序

5.  地址组 API

6.  输入/输出接口

7.  进程间通信

8.  套接字接口

9.  使用 XTI 和 TLI 编程

10.  包过滤钩子

11.  传输选择和名称到地址映射

12.  实时编程和管理

13.  Solaris ABI 和 ABI 工具

A.  UNIX 域套接字

索引

会话描述 API 概述

组成 SDP API 的函数调用由共享对象 libcommputil.so.1 提供。此共享对象中的函数可解析 SDP 描述以及检查该描述的语法。

sdp.h 头文件定义 sdp_session_t 结构,该结构包含以下成员:

typedef    struct sdp_session {
   int             sdp_session_version; /* SDP session verstion */
   int             s_version;           /* SDP version field */
   sdp_origin_t    *s_origin;           /* SDP origin field */
   char            *s_name;             /* SDP name field */
   char            *s_info;             /* SDP info field */
   char            *s_uri;              /* SDP uri field */
   sdp_list_t      *s_email;            /* SDP email field */
   sdp_list_t      *s_phone;            /* SDP phone field */
   sdp_conn_t      *s_conn;             /* SDP connection field */
   sdp_bandwidth_t *s_bw;               /* SDP bandwidth field */
   sdp_time_t      *s_time;             /* SDP time field */
   sdp_zone_t      *s_zone;             /* SDP zone field */
   sdp_key_t       *s_key;              /* SDP key field */
   sdp_attr_t      *s_attr;             /* SDP attribute field */
   sdp_media_t     *s_media;            /* SDP media field */
} sdp_session_t;

sdp_session_version 成员可跟踪该结构的版本。sdp_session_version 成员的初始值为 SDP_SESSION_VERSION_1

sdp_origin_t 结构包含以下成员:

typedef struct sdp_origin {
   char        *o_username;  /* username of the originating host */
   uint64_t    o_id;         /* session id */
   uint64_t    o_version;    /* version number of this session */
                             /* description */
   char        *o_nettype;   /* type of network */
   char        *o_addrtype;  /* type of the address */
   char        *o_address;   /* address of the machine from which */
                             /* session was created */
} sdp_origin_t;

sdp_conn_t 结构包含以下成员:

typedef struct sdp_conn {
   char    *c_nettype;         /* type of network */
   char    *c_addrtype;        /* type of the address */
   char    *c_address;         /* unicast-address or multicast */
                               /* address */
   int     c_addrcount;        /* number of addresses (case of */
                               /* multicast address with layered */
                               /* encodings */
   struct  sdp_conn *c_next;   /* pointer to next connection */
                               /* structure; there could be several */
                               /* connection fields in SDP description */
   uint8_t c_ttl;              /* TTL value for IPV4 multicast address */
} sdp_conn_t;

sdp_bandwidth_t 结构包含以下成员:

typedef struct sdp_bandwidth {
   char                  *b_type; /* info needed to interpret b_value */
   uint64_t              b_value; /* bandwidth value */
   struct sdp_bandwidth  *b_next; /* pointer to next bandwidth structure*/
                                  /* (there could be several bandwidth */
                                  /* fields in SDP description */
} sdp_bandwidth_t;

sdp_list_t 结构是 void 指针的链接列表。该结构包含 SDP 字段。对于 emailphone 等 SDP 结构字段,void 指针指向字符缓冲区。如果没有预定义元素数目,则可使用该结构来保留信息,就像在重复的 offset 字段中 void 指针保留整数值的情况一样。

sdp_list_t 结构包含以下成员:

typedef struct sdp_list {
   void            *value; /* string values in case of email, phone and */
                           /* format (in media field) or integer values */
                           /* in case of offset (in repeat field) */
   struct sdp_list *next;  /* pointer to the next node in the list */
} sdp_list_t;

sdp_repeat_t 结构将始终是时间结构 sdp_time_t 的一部分。repeat 字段不会单独出现在 SDP 描述中,该字段始终与 time 字段关联。

sdp_repeat_t 结构包含以下成员:

typedef struct sdp_repeat {
   uint64_t          r_interval; /* repeat interval, e.g. 86400 seconds */
                                 /* (1 day) */
   uint64_t          r_duration; /* duration of session, e.g. 3600 */
                                 /* seconds (1 hour) */
   sdp_list_t        *r_offset;  /* linked list of offset values; each */
                                 /* represents offset from start-time */
                                 /* in the SDP time field */
   struct sdp_repeat *r_next;    /* pointer to next repeat structure; */
                                 /* there could be several repeat */
                                 /* fields in the SDP description */

sdp_time_t 结构包含以下成员:

typedef struct sdp_time {
   uint64_t         t_start;   /* start-time for a session */
   uint64_t         t_stop;    /* end-time for a session */
   sdp_repeat_t     *t_repeat; /* points to the SDP repeat field */
   struct sdp_time  *t_next;   /* pointer to next time field; there */
                               /* could there could be several time */
                               /* fields in SDP description */
} sdp_time_t;

sdp_zone_t 结构包含以下成员:

typedef struct sdp_zone {
   uint64_t        z_time;    /* base time */
   char            *z_offset; /* offset added to z_time to determine */
                              /* session time; mainly used for daylight */
                              /* saving time conversions */
   struct sdp_zone *z_next;   /* pointer to next zone field; there */
                              /* could be several <adjustment-time> */
                              /* <offset> pairs within a zone field */
} sdp_zone_t;

sdp_key_t 结构包含以下成员:

typedef struct sdp_key {
   char   *k_method;   /* key type */
   char   *k_enckey;   /* encryption key */
 } sdp_key_t;

sdp_attr_t 结构包含以下成员:

typedef struct sdp_attr {
   char            *a_name;  /* name of the attribute */
   char            *a_value; /* value of the attribute */
   struct sdp_attr *a_next;  /* pointer to the next attribute */
                             /* structure; there could be several */
                             /* attribute fields within SDP description */
} sdp_attr_t;

sdp_media_t 结构包含以下成员:

typedef struct sdp_media {
   char              *m_name;     /* name of the media such as "audio", */
                                  /* "video", "message" */
   uint_t            m_port;      /* transport layer port information */
   int               m_portcount; /* number of ports in case of */
                                  /* hierarchically encoded streams */
   char              *m_proto;    /* transport protocol */
   sdp_list_t        *m_format;   /* media format description */
   char              *m_info;     /* media info field */
   sdp_conn_t        *m_conn;     /* media connection field */
   sdp_bandwidth_t   *m_bw;       /* media bandwidth field */
   sdp_key_t         *m_key;      /* media key field */
   sdp_attr_t        *m_attr;     /* media attribute field */
   struct sdp_media  *m_next;     /* pointer to next media structure; */
                                  /* there could be several media */
                                  /* sections in SDP description */
   sdp_session_t     *m_session;  /* pointer to the session structure */
} sdp_media_t;