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

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

?? avdtp.c

?? 基于LINUX內核驅動的開發
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* * *  BlueZ - Bluetooth protocol stack for Linux * *  Copyright (C) 2006-2007  Nokia Corporation *  Copyright (C) 2004-2008  Marcel Holtmann <marcel@holtmann.org> * * *  This program is free software; you can redistribute it and/or modify *  it under the terms of the GNU General Public License as published by *  the Free Software Foundation; either version 2 of the License, or *  (at your option) any later version. * *  This program 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 General Public License for more details. * *  You should have received a copy of the GNU General Public License *  along with this program; if not, write to the Free Software *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA * */#ifdef HAVE_CONFIG_H#include <config.h>#endif#include <stdio.h>#include <stdint.h>#include <errno.h>#include <unistd.h>#include <assert.h>#include <signal.h>#include <netinet/in.h>#include <glib.h>#include <bluetooth/bluetooth.h>#include <bluetooth/sdp.h>#include "dbus.h"#include "logging.h"#include "device.h"#include "manager.h"#include "control.h"#include "avdtp.h"#include <bluetooth/l2cap.h>#define AVDTP_PSM 25#define MAX_SEID 0x3E#define AVDTP_DISCOVER				0x01#define AVDTP_GET_CAPABILITIES			0x02#define AVDTP_SET_CONFIGURATION			0x03#define AVDTP_GET_CONFIGURATION			0x04#define AVDTP_RECONFIGURE			0x05#define AVDTP_OPEN				0x06#define AVDTP_START				0x07#define AVDTP_CLOSE				0x08#define AVDTP_SUSPEND				0x09#define AVDTP_ABORT				0x0A#define AVDTP_SECURITY_CONTROL			0x0B#define AVDTP_PKT_TYPE_SINGLE			0x00#define AVDTP_PKT_TYPE_START			0x01#define AVDTP_PKT_TYPE_CONTINUE			0x02#define AVDTP_PKT_TYPE_END			0x03#define AVDTP_MSG_TYPE_COMMAND			0x00#define AVDTP_MSG_TYPE_ACCEPT			0x02#define AVDTP_MSG_TYPE_REJECT			0x03#define REQ_TIMEOUT 4000#define DISCONNECT_TIMEOUT 5000#define STREAM_TIMEOUT 20000typedef enum {	AVDTP_SESSION_STATE_DISCONNECTED,	AVDTP_SESSION_STATE_CONNECTING,	AVDTP_SESSION_STATE_CONNECTED} avdtp_session_state_t;#if __BYTE_ORDER == __LITTLE_ENDIANstruct avdtp_header {	uint8_t message_type:2;	uint8_t packet_type:2;	uint8_t transaction:4;	uint8_t signal_id:6;	uint8_t rfa0:2;} __attribute__ ((packed));struct seid_info {	uint8_t rfa0:1;	uint8_t inuse:1;	uint8_t seid:6;	uint8_t rfa2:3;	uint8_t type:1;	uint8_t media_type:4;} __attribute__ ((packed));struct seid {	uint8_t rfa0:2;	uint8_t seid:6;} __attribute__ ((packed));#elif __BYTE_ORDER == __BIG_ENDIANstruct avdtp_header {	uint8_t transaction:4;	uint8_t packet_type:2;	uint8_t message_type:2;	uint8_t rfa0:2;	uint8_t signal_id:6;} __attribute__ ((packed));struct seid_info {	uint8_t seid:6;	uint8_t inuse:1;	uint8_t rfa0:1;	uint8_t media_type:4;	uint8_t type:1;	uint8_t rfa2:3;} __attribute__ ((packed));struct seid {	uint8_t seid:6;	uint8_t rfa0:2;} __attribute__ ((packed));#else#error "Unknown byte order"#endif/* packets */struct gen_req {	struct avdtp_header header;} __attribute__ ((packed));struct gen_resp {	struct avdtp_header header;} __attribute__ ((packed));struct discover_resp {	struct avdtp_header header;	struct seid_info seps[0];} __attribute__ ((packed));struct getcap_resp {	struct avdtp_header header;	uint8_t caps[0];} __attribute__ ((packed));struct start_req {	struct avdtp_header header;	struct seid first_seid;	struct seid other_seids[0];} __attribute__ ((packed));struct suspend_req {	struct avdtp_header header;	struct seid first_seid;	struct seid other_seids[0];} __attribute__ ((packed));struct seid_rej {	struct avdtp_header header;	uint8_t error;} __attribute__ ((packed));struct conf_rej {	struct avdtp_header header;	uint8_t category;	uint8_t error;} __attribute__ ((packed));#if __BYTE_ORDER == __LITTLE_ENDIANstruct seid_req {	struct avdtp_header header;	uint8_t rfa0:2;	uint8_t acp_seid:6;} __attribute__ ((packed));struct setconf_req {	struct avdtp_header header;	uint8_t rfa0:2;	uint8_t acp_seid:6;	uint8_t rfa1:2;	uint8_t int_seid:6;	uint8_t caps[0];} __attribute__ ((packed));struct stream_rej {	struct avdtp_header header;	uint8_t rfa0:2;	uint8_t acp_seid:6;	uint8_t error;} __attribute__ ((packed));struct reconf_req {	struct avdtp_header header;	uint8_t rfa0:2;	uint8_t acp_seid:6;	uint8_t serv_cap;	uint8_t serv_cap_len;	uint8_t caps[0];} __attribute__ ((packed));struct avdtp_general_rej {	uint8_t message_type:2;	uint8_t packet_type:2;	uint8_t transaction:4;	uint8_t rfa0;} __attribute__ ((packed));#elif __BYTE_ORDER == __BIG_ENDIANstruct seid_req {	struct avdtp_header header;	uint8_t acp_seid:6;	uint8_t rfa0:2;} __attribute__ ((packed));struct setconf_req {	struct avdtp_header header;	uint8_t acp_seid:6;	uint8_t rfa0:2;	uint8_t int_seid:6;	uint8_t rfa1:2;	uint8_t caps[0];} __attribute__ ((packed));struct stream_rej {	struct avdtp_header header;	uint8_t acp_seid:6;	uint8_t rfa0:2;	uint8_t error;} __attribute__ ((packed));struct reconf_req {	struct avdtp_header header;	uint8_t acp_seid:6;	uint8_t rfa0:2;	uint8_t serv_cap;	uint8_t serv_cap_len;	uint8_t caps[0];} __attribute__ ((packed));struct avdtp_general_rej {	uint8_t transaction:4;	uint8_t packet_type:2;	uint8_t message_type:2;	uint8_t rfa0;} __attribute__ ((packed));#else#error "Unknown byte order"#endifstruct pending_req {	struct avdtp_header *msg;	int msg_size;	struct avdtp_stream *stream; /* Set if the request targeted a stream */	guint timeout;};struct avdtp_remote_sep {	uint8_t seid;	uint8_t type;	uint8_t media_type;	struct avdtp_service_capability *codec;	GSList *caps; /* of type struct avdtp_service_capability */	struct avdtp_stream *stream;};struct avdtp_local_sep {	avdtp_state_t state;	struct avdtp_stream *stream;	struct seid_info info;	uint8_t codec;	GSList *caps;	struct avdtp_sep_ind *ind;	struct avdtp_sep_cfm *cfm;	void *user_data;};struct stream_callback {	avdtp_stream_state_cb cb;	void *user_data;	unsigned int id;};struct avdtp_stream {	int sock;	uint16_t imtu;	uint16_t omtu;	struct avdtp *session;	struct avdtp_local_sep *lsep;	uint8_t rseid;	GSList *caps;	GSList *callbacks;	struct avdtp_service_capability *codec;	guint io;		/* Transport GSource ID */	guint timer;		/* Waiting for other side to close or open				   the transport channel */	gboolean open_acp;	/* If we are in ACT role for Open */	gboolean close_int;	/* If we are in INT role for Close */	guint idle_timer;};/* Structure describing an AVDTP connection between two devices */struct avdtp {	int ref;	int free_lock;	bdaddr_t src;	bdaddr_t dst;	avdtp_session_state_t last_state;	avdtp_session_state_t state;	guint io;	int sock;	GSList *seps; /* Elements of type struct avdtp_remote_sep * */	GSList *streams; /* Elements of type struct avdtp_stream * */	GSList *req_queue; /* Elements of type struct pending_req * */	GSList *prio_queue; /* Same as req_queue but is processed before it */	struct avdtp_stream *pending_open;	uint16_t mtu;	char *buf;	avdtp_discover_cb_t discov_cb;	void *user_data;	struct pending_req *req;	guint dc_timer;	DBusPendingCall *pending_auth;};static uint8_t free_seid = 1;static GSList *local_seps = NULL;static GIOChannel *avdtp_server = NULL;static GSList *sessions = NULL;static int send_request(struct avdtp *session, gboolean priority,			struct avdtp_stream *stream, void *buffer, int size);static gboolean avdtp_parse_resp(struct avdtp *session,					struct avdtp_stream *stream,					struct avdtp_header *header, int size);static gboolean avdtp_parse_rej(struct avdtp *session,				struct avdtp_stream *stream,				struct avdtp_header *header, int size);static int process_queue(struct avdtp *session);static void connection_lost(struct avdtp *session, int err);static void avdtp_sep_set_state(struct avdtp *session,				struct avdtp_local_sep *sep,				avdtp_state_t state);static const char *avdtp_statestr(avdtp_state_t state){	switch (state) {	case AVDTP_STATE_IDLE:		return "IDLE";	case AVDTP_STATE_CONFIGURED:		return "CONFIGURED";	case AVDTP_STATE_OPEN:		return "OPEN";	case AVDTP_STATE_STREAMING:		return "STREAMING";	case AVDTP_STATE_CLOSING:		return "CLOSING";	case AVDTP_STATE_ABORTING:		return "ABORTING";	default:		return "<unknown state>";	}}static gboolean avdtp_send(struct avdtp *session, void *data, int len){	int ret;	if (session->sock < 0) {		error("avdtp_send: session is closed");		return FALSE;	}	ret = send(session->sock, data, len, 0);	if (ret < 0)		ret = -errno;	else if (ret != len)		ret = -EIO;	if (ret < 0) {		error("avdtp_send: %s (%d)", strerror(-ret), -ret);		return FALSE;	}	return TRUE;}static void pending_req_free(struct pending_req *req){	if (req->timeout)		g_source_remove(req->timeout);	g_free(req->msg);	g_free(req);}static gboolean stream_close_timeout(gpointer user_data){	struct avdtp_stream *stream = user_data;	debug("Timed out waiting for peer to close the transport channel");	stream->timer = 0;	close(stream->sock);	return FALSE;}static gboolean stream_open_timeout(gpointer user_data){	struct avdtp_stream *stream = user_data;	debug("Timed out waiting for peer to open the transport channel");	stream->timer = 0;	stream->session->pending_open = NULL;	avdtp_abort(stream->session, stream);	return FALSE;}static gboolean disconnect_timeout(gpointer user_data){	struct avdtp *session = user_data;	assert(session->ref == 1);	session->dc_timer = 0;	connection_lost(session, -ETIMEDOUT);	return FALSE;}static void remove_disconnect_timer(struct avdtp *session){	g_source_remove(session->dc_timer);	session->dc_timer = 0;}static void set_disconnect_timer(struct avdtp *session){	if (session->dc_timer)		remove_disconnect_timer(session);	session->dc_timer = g_timeout_add(DISCONNECT_TIMEOUT,						disconnect_timeout, session);}void avdtp_error_init(struct avdtp_error *err, uint8_t type, int id){	err->type = type;	switch (type) {	case AVDTP_ERROR_ERRNO:		err->err.posix_errno = id;		break;	case AVDTP_ERROR_ERROR_CODE:		err->err.error_code = id;		break;	}}avdtp_error_type_t avdtp_error_type(struct avdtp_error *err){	return err->type;}int avdtp_error_error_code(struct avdtp_error *err){	assert(err->type == AVDTP_ERROR_ERROR_CODE);	return err->err.error_code;}int avdtp_error_posix_errno(struct avdtp_error *err){	assert(err->type == AVDTP_ERROR_ERRNO);	return err->err.posix_errno;}static struct avdtp_stream *find_stream_by_rseid(struct avdtp *session,							uint8_t rseid){	GSList *l;	for (l = session->streams; l != NULL; l = g_slist_next(l)) {		struct avdtp_stream *stream = l->data;		if (stream->rseid == rseid)			return stream;	}	return NULL;}static struct avdtp_remote_sep *find_remote_sep(GSList *seps, uint8_t seid){	GSList *l;	for (l = seps; l != NULL; l = g_slist_next(l)) {		struct avdtp_remote_sep *sep = l->data;		if (sep->seid == seid)			return sep;	}	return NULL;}static void stream_free(struct avdtp_stream *stream){	struct avdtp_remote_sep *rsep;	stream->lsep->info.inuse = 0;	stream->lsep->stream = NULL;	rsep = find_remote_sep(stream->session->seps, stream->rseid);	if (rsep)		rsep->stream = NULL;	if (stream->timer)		g_source_remove(stream->timer);	if (stream->sock >= 0)		close(stream->sock);	if (stream->io)		g_source_remove(stream->io);	g_slist_foreach(stream->callbacks, (GFunc) g_free, NULL);	g_slist_free(stream->callbacks);	g_slist_foreach(stream->caps, (GFunc) g_free, NULL);	g_slist_free(stream->caps);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲色图欧洲色图婷婷| 中文在线免费一区三区高中清不卡| 亚洲天堂免费看| 成人免费视频免费观看| 国产精品美女一区二区三区| 不卡的电影网站| 亚洲色图欧美偷拍| 色狠狠桃花综合| 日本成人在线看| 日韩欧美国产电影| 国产成人午夜99999| 成人免费视频在线观看| 在线观看日韩国产| 看电影不卡的网站| 国产日韩欧美精品综合| 成人av动漫在线| 亚洲在线视频免费观看| 日韩丝袜美女视频| 激情综合网av| 中文字幕亚洲一区二区va在线| 91在线一区二区三区| 亚洲成av人片在线观看| 精品盗摄一区二区三区| 99国产欧美另类久久久精品| 日韩激情一二三区| 久久亚洲影视婷婷| 欧美艳星brazzers| 麻豆国产精品官网| 成人免费一区二区三区视频| 欧美日本高清视频在线观看| 国产suv一区二区三区88区| 亚洲综合在线第一页| 日韩欧美一区二区免费| 色婷婷av一区二区三区软件 | 久久久久高清精品| 色拍拍在线精品视频8848| 精品中文字幕一区二区| 亚洲天堂久久久久久久| 精品播放一区二区| 欧美日本免费一区二区三区| 国产精品1区2区3区在线观看| 夜色激情一区二区| 日本一区二区三级电影在线观看| 精品视频一区 二区 三区| 国产精品中文有码| 日韩极品在线观看| 亚洲女爱视频在线| 国产欧美精品一区| 日韩欧美中文一区| 欧美日韩电影在线播放| 99久久精品免费看国产免费软件| 另类调教123区 | 99精品欧美一区| 久久99蜜桃精品| 男女男精品视频网| 亚洲444eee在线观看| 亚洲人吸女人奶水| 亚洲视频资源在线| 国产亚洲欧美日韩在线一区| 91.麻豆视频| 欧美亚洲国产怡红院影院| 99在线精品观看| 大陆成人av片| 成人精品一区二区三区四区| 国产激情一区二区三区四区| 青青草成人在线观看| 五月天亚洲婷婷| 亚洲午夜激情网页| 五月天激情综合网| 亚洲午夜免费福利视频| 亚洲精品日韩一| 一区二区三区中文在线| 亚洲视频香蕉人妖| 亚洲人吸女人奶水| 国产精品免费视频网站| 中文子幕无线码一区tr| 国产精品美女久久久久久2018 | 不卡的电影网站| 成人亚洲精品久久久久软件| 国产一区二区三区最好精华液| 久久疯狂做爰流白浆xx| 欧美aaa在线| 狠狠色狠狠色综合系列| 久久国产精品色婷婷| 久国产精品韩国三级视频| 国产在线一区二区综合免费视频| 蜜臀av性久久久久蜜臀aⅴ| 精品无人码麻豆乱码1区2区| 奇米四色…亚洲| 国产综合久久久久影院| 波多野结衣的一区二区三区| 91在线观看视频| 欧美日韩亚洲不卡| 欧美一激情一区二区三区| 日韩欧美亚洲国产另类| 久久蜜桃av一区二区天堂 | 欧美精品v国产精品v日韩精品| 欧美日韩国产小视频| 91精品中文字幕一区二区三区| 日韩精品一区在线| 中文字幕亚洲成人| 亚洲精品乱码久久久久久| 一区二区理论电影在线观看| 亚洲大片精品永久免费| 狠狠色丁香久久婷婷综合_中| 国产大片一区二区| 在线视频中文字幕一区二区| 91精品国产一区二区人妖| 久久久久久久久久久99999| **性色生活片久久毛片| 亚洲成人精品一区| 国产成人自拍在线| 欧美在线不卡视频| 精品国产一区二区三区忘忧草 | 久久综合狠狠综合久久激情| 亚洲国产精品黑人久久久| 亚洲制服丝袜在线| 国产白丝精品91爽爽久久| 欧美色视频在线| 国产日韩欧美激情| 丝袜国产日韩另类美女| 国产伦理精品不卡| 欧美日韩精品一区二区天天拍小说| 91精品国产免费| 亚洲人xxxx| 国产一区美女在线| 欧美日韩黄视频| 国产精品国产馆在线真实露脸| 亚洲国产日韩a在线播放| 国产精品白丝jk黑袜喷水| 欧美日韩视频第一区| 国产欧美日韩综合精品一区二区| 午夜精彩视频在线观看不卡| 国产精品一区一区| 日韩美女视频在线| 亚洲一区视频在线| www.亚洲在线| 久久久99精品免费观看不卡| 亚洲成人av福利| 99久久精品免费看国产免费软件| 日韩精品中文字幕一区| 一区二区三区成人| www.成人在线| 久久久综合九色合综国产精品| 日韩精品一二三四| 91麻豆自制传媒国产之光| 国产亚洲精品精华液| 日本在线不卡视频| 欧美精品一二三| 一区二区欧美视频| 色狠狠色噜噜噜综合网| 亚洲欧美在线视频| 国产成人鲁色资源国产91色综| 精品国产凹凸成av人网站| 蜜臀久久久久久久| 欧美日本在线视频| 婷婷久久综合九色综合伊人色| 在线一区二区三区做爰视频网站| 中日韩免费视频中文字幕| 国产精品一区不卡| 久久新电视剧免费观看| 国产又黄又大久久| 精品国产成人系列| 国产精品一区在线| 久久综合色8888| 国产精品一二三四| 国产精品美日韩| 成人毛片老司机大片| 亚洲欧洲性图库| 99精品欧美一区二区三区小说| 亚洲欧洲精品一区二区三区不卡| 成av人片一区二区| 国产精品美女久久久久高潮| jvid福利写真一区二区三区| 中文字幕一区二区在线观看| 91丨九色porny丨蝌蚪| 亚洲综合另类小说| 欧美日韩国产在线观看| 日产国产欧美视频一区精品 | 成人精品视频一区| 中文字幕不卡在线观看| av资源网一区| 一区二区三区在线视频免费观看| 色婷婷av一区二区三区之一色屋| 亚洲一区二区三区四区在线| 欧美日韩另类国产亚洲欧美一级| 日韩成人精品在线观看| 日韩三级在线观看| 国产精品一区二区三区网站| 国产精品欧美久久久久无广告| 色婷婷狠狠综合| 日本va欧美va瓶| 国产蜜臀av在线一区二区三区| 99精品久久只有精品| 午夜精品久久久久影视| 精品乱人伦一区二区三区| 成人黄色av电影| 午夜av区久久| 国产亚洲精品bt天堂精选| 色偷偷久久一区二区三区|