亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ice_session.h

?? 一個開源的sip源代碼
?? H
?? 第 1 頁 / 共 2 頁
字號:
    /**
     * A mandatory callback which will be called by the ICE session when
     * it receives packet which is not part of ICE negotiation.
     *
     * @param ice	    The ICE session.
     * @param comp_id	    ICE component ID.
     * @param pkt	    The whole packet.
     * @param size	    Size of the packet.
     * @param src_addr	    Source address where this packet was received 
     *			    from.
     * @param src_addr_len  The length of source address.
     */
    void	(*on_rx_data)(pj_ice_sess *ice, unsigned comp_id,
			      void *pkt, pj_size_t size,
			      const pj_sockaddr_t *src_addr,
			      unsigned src_addr_len);
} pj_ice_sess_cb;


/**
 * This enumeration describes the role of the ICE agent.
 */
typedef enum pj_ice_sess_role
{
    /**
     * The ICE agent is in controlled role.
     */
    PJ_ICE_SESS_ROLE_UNKNOWN,

    /**
     * The ICE agent is in controlled role.
     */
    PJ_ICE_SESS_ROLE_CONTROLLED,

    /**
     * The ICE agent is in controlling role.
     */
    PJ_ICE_SESS_ROLE_CONTROLLING

} pj_ice_sess_role;


/**
 * This structure represents an incoming check (an incoming Binding
 * request message), and is mainly used to keep early checks in the
 * list in the ICE session. An early check is a request received
 * from remote when we haven't received SDP answer yet, therefore we
 * can't perform triggered check. For such cases, keep the incoming
 * request in a list, and we'll do triggered checks (simultaneously)
 * as soon as we receive answer.
 */
typedef struct pj_ice_rx_check
{
    PJ_DECL_LIST_MEMBER(struct pj_ice_rx_check);

    unsigned		 comp_id;	/**< Component ID.		*/

    pj_sockaddr		 src_addr;	/**< Source address of request	*/
    unsigned		 src_addr_len;	/**< Length of src address.	*/

    pj_bool_t		 use_candidate;	/**< USE-CANDIDATE is present?	*/
    pj_uint32_t		 priority;	/**< PRIORITY value in the req.	*/
    pj_stun_uint64_attr *role_attr;	/**< ICE-CONTROLLING/CONTROLLED	*/

} pj_ice_rx_check;


/**
 * This structure describes the ICE session. For this version of PJNATH,
 * an ICE session corresponds to a single media stream (unlike the ICE
 * session described in the ICE standard where an ICE session covers the
 * whole media and may consist of multiple media streams). The decision
 * to support only a single media session was chosen for simplicity,
 * while still allowing application to utilize multiple media streams by
 * creating multiple ICE sessions, one for each media stream.
 */
struct pj_ice_sess
{
    char		obj_name[PJ_MAX_OBJ_NAME];  /**< Object name.	    */

    pj_pool_t		*pool;			    /**< Pool instance.	    */
    void		*user_data;		    /**< App. data.	    */
    pj_mutex_t		*mutex;			    /**< Mutex.		    */
    pj_ice_sess_role	 role;			    /**< ICE role.	    */
    pj_timestamp	 tie_breaker;		    /**< Tie breaker value  */
    pj_uint8_t		*prefs;			    /**< Type preference.   */
    pj_bool_t		 is_complete;		    /**< Complete?	    */
    pj_status_t		 ice_status;		    /**< Error status.	    */
    pj_ice_sess_cb	 cb;			    /**< Callback.	    */

    pj_stun_config	 stun_cfg;		    /**< STUN settings.	    */

    /* STUN credentials */
    pj_str_t		 tx_ufrag;		    /**< Remote ufrag.	    */
    pj_str_t		 tx_uname;		    /**< Uname for TX.	    */
    pj_str_t		 tx_pass;		    /**< Remote password.   */
    pj_str_t		 rx_ufrag;		    /**< Local ufrag.	    */
    pj_str_t		 rx_uname;		    /**< Uname for RX	    */
    pj_str_t		 rx_pass;		    /**< Local password.    */

    /* Components */
    unsigned		 comp_cnt;		    /**< # of components.   */
    pj_ice_sess_comp	 comp[PJ_ICE_MAX_COMP];	    /**< Component array    */

    /* Local candidates */
    unsigned		 lcand_cnt;		    /**< # of local cand.   */
    pj_ice_sess_cand	 lcand[PJ_ICE_MAX_CAND];    /**< Array of cand.	    */

    /* Remote candidates */
    unsigned		 rcand_cnt;		    /**< # of remote cand.  */
    pj_ice_sess_cand	 rcand[PJ_ICE_MAX_CAND];    /**< Array of cand.	    */

    /* List of eearly checks */
    pj_ice_rx_check	 early_check;		    /**< Early checks.	    */

    /* Checklist */
    pj_ice_sess_checklist clist;		    /**< Active checklist   */
    
    /* Valid list */
    pj_ice_sess_checklist valid_list;		    /**< Valid list.	    */
};


/**
 * This is a utility function to retrieve the string name for the
 * particular candidate type.
 *
 * @param type		Candidate type.
 *
 * @return		The string representation of the candidate type.
 */
PJ_DECL(const char*) pj_ice_get_cand_type_name(pj_ice_cand_type type);


/**
 * This is a utility function to calculate the foundation identification
 * for a candidate.
 *
 * @param pool		Pool to allocate the foundation string.
 * @param foundation	Pointer to receive the foundation string.
 * @param type		Candidate type.
 * @param base_addr	Base address of the candidate.
 */
PJ_DECL(void) pj_ice_calc_foundation(pj_pool_t *pool,
				     pj_str_t *foundation,
				     pj_ice_cand_type type,
				     const pj_sockaddr *base_addr);


/**
 * Create ICE session with the specified role and number of components.
 * Application would typically need to create an ICE session before
 * sending an offer or upon receiving one. After the session is created,
 * application can register candidates to the ICE session by calling
 * #pj_ice_sess_add_cand() function.
 *
 * @param stun_cfg	The STUN configuration settings, containing among
 *			other things the timer heap instance to be used
 *			by the ICE session.
 * @param name		Optional name to identify this ICE instance in
 *			the log file.
 * @param role		ICE role.
 * @param comp_cnt	Number of components.
 * @param cb		ICE callback.
 * @param local_ufrag	Optional string to be used as local username to
 *			authenticate incoming STUN binding request. If
 *			the value is NULL, a random string will be 
 *			generated.
 * @param local_passwd	Optional string to be used as local password.
 * @param p_ice		Pointer to receive the ICE session instance.
 *
 * @return		PJ_SUCCESS if ICE session is created successfully.
 */
PJ_DECL(pj_status_t) pj_ice_sess_create(pj_stun_config *stun_cfg,
				        const char *name,
				        pj_ice_sess_role role,
				        unsigned comp_cnt,
				        const pj_ice_sess_cb *cb,
				        const pj_str_t *local_ufrag,
				        const pj_str_t *local_passwd,
				        pj_ice_sess **p_ice);

/**
 * Destroy ICE session. This will cancel any connectivity checks currently
 * running, if any, and any other events scheduled by this session, as well
 * as all memory resources.
 *
 * @param ice		ICE session instance.
 *
 * @return		PJ_SUCCESS on success.
 */
PJ_DECL(pj_status_t) pj_ice_sess_destroy(pj_ice_sess *ice);


/**
 * Change session role. This happens for example when ICE session was
 * created with controlled role when receiving an offer, but it turns out
 * that the offer contains "a=ice-lite" attribute when the SDP gets
 * inspected.
 *
 * @param ice		The ICE session.
 * @param new_role	The new role to be set.
 *
 * @return		PJ_SUCCESS on success, or the appropriate error.
 */
PJ_DECL(pj_status_t) pj_ice_sess_change_role(pj_ice_sess *ice,
					     pj_ice_sess_role new_role);


/**
 * Assign a custom preference values for ICE candidate types. By assigning
 * custom preference value, application can control the order of candidates
 * to be checked first. The default preference settings is to use 126 for 
 * host candidates, 100 for server reflexive candidates, 110 for peer 
 * reflexive candidates, an 0 for relayed candidates.
 *
 * Note that this function must be called before any candidates are added
 * to the ICE session.
 *
 * @param ice		The ICE session.
 * @param prefs		Array of candidate preference value. The values are
 *			put in the array indexed by the candidate type as
 *			specified in pj_ice_cand_type.
 *
 * @return		PJ_SUCCESS on success, or the appropriate error code.
 */
PJ_DECL(pj_status_t) pj_ice_sess_set_prefs(pj_ice_sess *ice,
					   const pj_uint8_t prefs[4]);



/**
 * Add a candidate to this ICE session. Application must add candidates for
 * each components ID before it can start pairing the candidates and 
 * performing connectivity checks.
 *
 * @param ice		ICE session instance.
 * @param comp_id	Component ID of this candidate.
 * @param type		Candidate type.
 * @param local_pref	Local preference for this candidate, which
 *			normally should be set to 65535.
 * @param foundation	Foundation identification.
 * @param addr		The candidate address.
 * @param base_addr	The candidate's base address.
 * @param rel_addr	Optional related address.
 * @param addr_len	Length of addresses.
 * @param p_cand_id	Optional pointer to receive the candidate ID.
 *
 * @return		PJ_SUCCESS if candidate is successfully added.
 */
PJ_DECL(pj_status_t) pj_ice_sess_add_cand(pj_ice_sess *ice,
					  unsigned comp_id,
					  pj_ice_cand_type type,
					  pj_uint16_t local_pref,
					  const pj_str_t *foundation,
					  const pj_sockaddr_t *addr,
					  const pj_sockaddr_t *base_addr,
					  const pj_sockaddr_t *rel_addr,
					  int addr_len,
					  unsigned *p_cand_id);

/**
 * Find default candidate for the specified component ID, using this
 * rule:
 *  - if the component has a successful candidate pair, then the
 *    local candidate of this pair will be returned.
 *  - otherwise a relay, reflexive, or host candidate will be selected 
 *    on that specified order.
 *
 * @param ice		The ICE session instance.
 * @param comp_id	The component ID.
 * @param p_cand_id	Pointer to receive the candidate ID.
 *
 * @return		PJ_SUCCESS if a candidate has been selected.
 */
PJ_DECL(pj_status_t) pj_ice_sess_find_default_cand(pj_ice_sess *ice,
						   unsigned comp_id,
						   int *p_cand_id);

/**
 * Pair the local and remote candidates to create check list. Application
 * typically would call this function after receiving SDP containing ICE
 * candidates from the remote host (either upon receiving the initial
 * offer, for UAS, or upon receiving the answer, for UAC).
 *
 * Note that ICE connectivity check will not start until application calls
 * #pj_ice_sess_start_check().
 *
 * @param ice		ICE session instance.
 * @param rem_ufrag	Remote ufrag, as seen in the SDP received from 
 *			the remote agent.
 * @param rem_passwd	Remote password, as seen in the SDP received from
 *			the remote agent.
 * @param rem_cand_cnt	Number of remote candidates.
 * @param rem_cand	Remote candidate array. Remote candidates are
 *			gathered from the SDP received from the remote 
 *			agent.
 *
 * @return		PJ_SUCCESS or the appropriate error code.
 */
PJ_DECL(pj_status_t) 
pj_ice_sess_create_check_list(pj_ice_sess *ice,
			      const pj_str_t *rem_ufrag,
			      const pj_str_t *rem_passwd,
			      unsigned rem_cand_cnt,
			      const pj_ice_sess_cand rem_cand[]);

/**
 * Start ICE periodic check. This function will return immediately, and
 * application will be notified about the connectivity check status in
 * #pj_ice_sess_cb callback.
 *
 * @param ice		The ICE session instance.
 *
 * @return		PJ_SUCCESS or the appropriate error code.
 */
PJ_DECL(pj_status_t) pj_ice_sess_start_check(pj_ice_sess *ice);


/**
 * Send data using this ICE session. If ICE checks have not produced a
 * valid check for the specified component ID, this function will return
 * with failure. Otherwise ICE session will send the packet to remote
 * destination using the nominated local candidate for the specified
 * component.
 *
 * This function will in turn call \a on_tx_pkt function in
 * #pj_ice_sess_cb callback to actually send the packet to the wire.
 *
 * @param ice		The ICE session.
 * @param comp_id	Component ID.
 * @param data		The data or packet to be sent.
 * @param data_len	Size of data or packet, in bytes.
 *
 * @return		PJ_SUCCESS if data is sent successfully.
 */
PJ_DECL(pj_status_t) pj_ice_sess_send_data(pj_ice_sess *ice,
					   unsigned comp_id,
					   const void *data,
					   pj_size_t data_len);

/**
 * Report the arrival of packet to the ICE session. Since ICE session
 * itself doesn't have any transports, it relies on application or
 * higher layer component to give incoming packets to the ICE session.
 * If the packet is not a STUN packet, this packet will be given back
 * to application via \a on_rx_data() callback in #pj_ice_sess_cb.
 *
 * @param ice		The ICE session.
 * @param comp_id	Component ID.
 * @param pkt		Incoming packet.
 * @param pkt_size	Size of incoming packet.
 * @param src_addr	Source address of the packet.
 * @param src_addr_len	Length of the address.
 *
 * @return		PJ_SUCCESS or the appropriate error code.
 */
PJ_DECL(pj_status_t) pj_ice_sess_on_rx_pkt(pj_ice_sess *ice,
					   unsigned comp_id,
					   void *pkt,
					   pj_size_t pkt_size,
					   const pj_sockaddr_t *src_addr,
					   int src_addr_len);



/**
 * @}
 */


PJ_END_DECL


#endif	/* __PJNATH_ICE_SESSION_H__ */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩在线一区二区| 51精品秘密在线观看| 欧美精品第1页| 国产丝袜欧美中文另类| 亚洲一区二区黄色| 岛国一区二区在线观看| 日韩欧美一二区| 亚洲图片欧美综合| 91老司机福利 在线| 久久精品人人做| 免费看欧美女人艹b| 在线观看亚洲精品视频| 成人免费在线播放视频| 国产一区二区福利| 日韩精品一区二区三区swag| 亚洲高清不卡在线观看| 色综合欧美在线视频区| 国产精品动漫网站| 成人黄色综合网站| 国产欧美综合色| 国产一区日韩二区欧美三区| 欧美一区二区三区白人| 亚洲成人免费视频| 91精品黄色片免费大全| 亚洲电影欧美电影有声小说| 91日韩精品一区| 国产精品全国免费观看高清| 国产精品99久| 国产婷婷色一区二区三区四区| 久久精品久久99精品久久| 欧美日韩国产一区二区三区地区| 亚洲激情五月婷婷| 色婷婷综合久久| 亚洲精品乱码久久久久久黑人| 99天天综合性| 一区二区三区日韩欧美精品| 在线视频一区二区三| 亚洲综合色网站| 在线欧美一区二区| 午夜精品福利一区二区蜜股av| 欧美午夜电影在线播放| 爽好久久久欧美精品| 欧美丰满少妇xxxxx高潮对白| 日本不卡中文字幕| 欧美成人欧美edvon| 国产伦精一区二区三区| 国产精品视频一二三区 | 亚洲精品欧美激情| 欧美日韩亚洲不卡| 久久福利资源站| 久久蜜臀中文字幕| 97超碰欧美中文字幕| 夜夜精品浪潮av一区二区三区| 欧美日精品一区视频| 久久99热这里只有精品| 国产亚洲欧美日韩在线一区| 99国产精品久久久久久久久久 | 国产精品丝袜在线| 欧美在线free| 国内外成人在线视频| 国产精品理伦片| 337p亚洲精品色噜噜噜| 国产九九视频一区二区三区| 久久在线观看免费| 91啪九色porn原创视频在线观看| 亚洲一区二区三区自拍| 久久蜜桃av一区二区天堂| 91在线视频播放地址| 毛片av一区二区| 亚洲欧美在线视频| 日韩免费观看2025年上映的电影| www.99精品| 国内欧美视频一区二区| 亚洲一二三四在线观看| 久久精品亚洲国产奇米99| 欧美精品777| av男人天堂一区| 激情六月婷婷久久| 亚洲高清三级视频| 自拍av一区二区三区| 精品国一区二区三区| 欧美日韩在线直播| 91在线国产福利| 国产精品自在欧美一区| 日韩电影在线观看一区| 日韩码欧中文字| 久久久美女毛片| 日韩亚洲欧美在线观看| 欧美日韩视频一区二区| 99久久精品免费看国产| 精品一区二区三区在线观看 | 久久狠狠亚洲综合| 亚洲成人动漫在线观看| 亚洲视频香蕉人妖| 亚洲国产成人自拍| 久久精品一区四区| 精品人伦一区二区色婷婷| 欧美一区二区免费观在线| 日本精品一区二区三区高清| 不卡影院免费观看| 国产99精品在线观看| 国产一区免费电影| 国产麻豆精品视频| 国产真实乱对白精彩久久| 久久国产精品99久久久久久老狼| 日本不卡高清视频| 青青草一区二区三区| 日韩和欧美的一区| 日本伊人色综合网| 蜜臀久久99精品久久久久久9 | 亚洲三级电影全部在线观看高清| 国产欧美精品区一区二区三区| 精品久久久久久久久久久久久久久 | 337p粉嫩大胆色噜噜噜噜亚洲| 7777女厕盗摄久久久| 欧美日本乱大交xxxxx| 6080午夜不卡| 日韩三级电影网址| 精品久久久久一区| 久久色在线视频| 国产欧美一区二区精品婷婷| 亚洲国产精品传媒在线观看| 国产精品视频线看| 亚洲欧美日韩小说| 亚洲一区精品在线| 日韩av在线免费观看不卡| 日本va欧美va精品发布| 精品中文字幕一区二区小辣椒| 国产精品影视在线观看| va亚洲va日韩不卡在线观看| 91捆绑美女网站| 欧美日免费三级在线| 精品国产青草久久久久福利| 久久精品人人做| 亚洲资源中文字幕| 日本不卡在线视频| 成人国产一区二区三区精品| 色呦呦网站一区| 日韩精品一区二区在线观看| 国产偷v国产偷v亚洲高清| 一区二区免费看| 久久99在线观看| 91蜜桃传媒精品久久久一区二区| 欧美精品xxxxbbbb| 国产精品色婷婷| 亚洲va韩国va欧美va精品| 日韩电影在线免费| 99国内精品久久| 日韩欧美另类在线| 伊人婷婷欧美激情| 国产在线精品免费| 欧美性大战久久久久久久蜜臀| 日韩欧美美女一区二区三区| 亚洲人精品一区| 国产制服丝袜一区| 欧美日韩大陆一区二区| 国产日韩在线不卡| 日韩精品电影在线| 色av成人天堂桃色av| 26uuu久久综合| 午夜精品免费在线观看| 成人午夜大片免费观看| 日韩欧美色电影| 亚洲福利视频导航| 99精品欧美一区二区三区小说 | 粉嫩av一区二区三区| 欧美日韩高清影院| 亚洲九九爱视频| 国产盗摄视频一区二区三区| 7777精品伊人久久久大香线蕉的| 亚洲欧洲成人自拍| 国产suv精品一区二区883| 91麻豆精品国产自产在线| 一区二区三区四区视频精品免费 | 国内一区二区在线| 在线播放/欧美激情| 亚洲精品国产精品乱码不99 | 国产精品视频观看| 激情图片小说一区| 欧美一级黄色录像| 舔着乳尖日韩一区| 欧美亚洲自拍偷拍| 亚洲综合在线视频| 色综合久久88色综合天天6| 国产欧美日韩精品在线| 国产尤物一区二区在线| 91精品国产福利在线观看| 亚洲香蕉伊在人在线观| 91久久香蕉国产日韩欧美9色| 亚洲欧洲日产国码二区| 国产.欧美.日韩| 日本一区二区三区视频视频| 国产曰批免费观看久久久| wwwwxxxxx欧美| 精品午夜久久福利影院| 久久综合久久鬼色| 高清不卡一区二区在线| 中文乱码免费一区二区| caoporm超碰国产精品| 中文字幕中文乱码欧美一区二区 |