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

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

?? l2cap.c

?? bluetooth 開發(fā)程序bluez-hcidump-1.28
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * *  BlueZ - Bluetooth protocol stack for Linux * *  Copyright (C) 2000-2002  Maxim Krasnyansky <maxk@qualcomm.com> *  Copyright (C) 2003-2005  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 <errno.h>#include <unistd.h>#include <stdlib.h>#include <string.h>#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <bluetooth/bluetooth.h>#include <bluetooth/hci.h>#include <bluetooth/l2cap.h>#include "parser.h"#include "sdp.h"typedef struct {	uint16_t handle;	struct frame frm;} handle_info;#define HANDLE_TABLE_SIZE 10static handle_info handle_table[HANDLE_TABLE_SIZE];typedef struct {	uint16_t handle;	uint16_t cid;	uint16_t psm;	uint16_t num;	uint8_t mode;} cid_info;#define CID_TABLE_SIZE 20static cid_info cid_table[2][CID_TABLE_SIZE];#define SCID cid_table[0]#define DCID cid_table[1]static struct frame *add_handle(uint16_t handle){	register handle_info *t = handle_table;	register int i;	for (i = 0; i < HANDLE_TABLE_SIZE; i++)		if (!t[i].handle) {			t[i].handle = handle;			return &t[i].frm;		}	return NULL;}static struct frame *get_frame(uint16_t handle){	register handle_info *t = handle_table;	register int i;	for (i = 0; i < HANDLE_TABLE_SIZE; i++)		if (t[i].handle == handle)			return &t[i].frm;	return add_handle(handle);}static void add_cid(int in, uint16_t handle, uint16_t cid, uint16_t psm){	register cid_info *table = cid_table[in];	register int i, pos = -1;	uint16_t num = 1;	for (i = 0; i < CID_TABLE_SIZE; i++) {		if ((pos < 0 && !table[i].cid) || table[i].cid == cid)			pos = i;		if (table[i].psm == psm)			num++;	}	if (pos >= 0) {		table[pos].handle = handle;		table[pos].cid    = cid;		table[pos].psm    = psm;		table[pos].num    = num;		table[pos].mode   = 0;	}}static void del_cid(int in, uint16_t dcid, uint16_t scid){	register int t, i;	uint16_t cid[2];	if (!in) {		cid[0] = dcid;		cid[1] = scid;	} else {		cid[0] = scid;		cid[1] = dcid;	}	for (t = 0; t < 2; t++) {		for (i = 0; i < CID_TABLE_SIZE; i++)			if (cid_table[t][i].cid == cid[t]) {				cid_table[t][i].handle = 0;				cid_table[t][i].cid    = 0;				cid_table[t][i].psm    = 0;				cid_table[t][i].num    = 0;				cid_table[t][i].mode   = 0;				break;			}	}}static void del_handle(uint16_t handle){	register int t, i;	for (t = 0; t < 2; t++) {		for (i = 0; i < CID_TABLE_SIZE; i++)			if (cid_table[t][i].handle == handle) {				cid_table[t][i].handle = 0;				cid_table[t][i].cid    = 0;				cid_table[t][i].psm    = 0;				cid_table[t][i].num    = 0;				cid_table[t][i].mode   = 0;				break;			}	}}static uint16_t get_psm(int in, uint16_t cid){	register cid_info *table = cid_table[in];	register int i;	for (i = 0; i < CID_TABLE_SIZE; i++)		if (table[i].cid == cid)			return table[i].psm;	return parser.defpsm;}static uint16_t get_num(int in, uint16_t cid){	register cid_info *table = cid_table[in];	register int i;	for (i = 0; i < CID_TABLE_SIZE; i++)		if (table[i].cid == cid)			return table[i].num;	return 0;}static void set_mode(int in, uint16_t cid, uint8_t mode){	register cid_info *table = cid_table[in];	register int i;	for (i = 0; i < CID_TABLE_SIZE; i++)		if (table[i].cid == cid)			table[i].mode = mode;}static uint8_t get_mode(int in, uint16_t cid){	register cid_info *table = cid_table[in];	register int i;	for (i = 0; i < CID_TABLE_SIZE; i++)		if (table[i].cid == cid)			return table[i].mode;	return 0;}static uint32_t get_val(uint8_t *ptr, uint8_t len){	switch (len) {	case 1:		return *ptr;	case 2:		return btohs(bt_get_unaligned((uint16_t *) ptr));	case 4:		return btohl(bt_get_unaligned((uint32_t *) ptr));	}	return 0;}static char *reason2str(uint16_t reason){	switch (reason) {	case 0x0000:		return "Command not understood";	case 0x0001:		return "Signalling MTU exceeded";	case 0x0002:		return "Invalid CID in request";	default:		return "Reserved";	}}static char *connresult2str(uint16_t result){	switch (result) {	case 0x0000:		return "Connection successful";	case 0x0001:		return "Connection pending";	case 0x0002:		return "Connection refused - PSM not supported";	case 0x0003:		return "Connection refused - security block";	case 0x0004:		return "Connection refused - no resources available";	default:		return "Reserved";	}}static char *status2str(uint16_t status){	switch (status) {	case 0x0000:		return "No futher information available";	case 0x0001:		return "Authentication pending";	case 0x0002:		return "Authorization pending";	default:		return "Reserved";	}}static char *confresult2str(uint16_t result){	switch (result) {	case 0x0000:		return "Success";	case 0x0001:		return "Failure - unacceptable parameters";	case 0x0002:		return "Failure - rejected (no reason provided)";	case 0x0003:		return "Failure - unknown options";	default:		return "Reserved";	}}static char *inforesult2str(uint16_t result){	switch (result) {	case 0x0000:		return "Success";	case 0x0001:		return "Not supported";	default:		return "Reserved";	}}static char *type2str(uint8_t type){	switch (type) {	case 0x00:		return "No traffic";	case 0x01:		return "Best effort";	case 0x02:		return "Guaranteed";	default:		return "Reserved";	}}static char *mode2str(uint8_t mode){	switch (mode) {	case 0x00:		return "Basic";	case 0x01:		return "Retransmission";	case 0x02:		return "Flow control";	default:		return "Reserved";	}}static char *sar2str(uint8_t sar){	switch (sar) {	case 0x00:		return "Unsegmented";	case 0x01:		return "Start";	case 0x02:		return "End";	case 0x03:		return "Continuation";	default:		return "Bad SAR";	}}static char *supervisory2str(uint8_t supervisory){	switch (supervisory) {	case 0x00:		return "Receiver Ready (RR)";	case 0x01:		return "Reject (REJ)";	case 0x02:	case 0x03:		return "Reserved Supervisory";	default:		return "Bad Supervisory";	}}static inline void command_rej(int level, struct frame *frm){	l2cap_cmd_rej *h = frm->ptr;	uint16_t reason = btohs(h->reason);	uint32_t cid;	printf("Command rej: reason %d", reason);	switch (reason) {	case 0x0001:		printf(" mtu %d\n", get_val(frm->ptr + L2CAP_CMD_REJ_SIZE, 2));		break;	case 0x0002:		cid = get_val(frm->ptr + L2CAP_CMD_REJ_SIZE, 4);		printf(" dcid 0x%4.4x scid 0x%4.4x\n", cid & 0xffff, cid >> 16);		break;	default:		printf("\n");		break;	}	p_indent(level + 1, frm);	printf("%s\n", reason2str(reason));}static inline void conn_req(int level, struct frame *frm){	l2cap_conn_req *h = frm->ptr;	uint16_t psm = btohs(h->psm);	uint16_t scid = btohs(h->scid);	add_cid(frm->in, frm->handle, scid, psm);	if (p_filter(FILT_L2CAP))		return;	printf("Connect req: psm %d scid 0x%4.4x\n", psm, scid);}static inline void conn_rsp(int level, struct frame *frm){	l2cap_conn_rsp *h = frm->ptr;	uint16_t scid = btohs(h->scid);	uint16_t dcid = btohs(h->dcid);	uint16_t result = btohs(h->result);	uint16_t status = btohs(h->status);	uint16_t psm;	switch (h->result) {	case L2CAP_CR_SUCCESS:		if ((psm = get_psm(!frm->in, scid)))			add_cid(frm->in, frm->handle, dcid, psm);		break;	case L2CAP_CR_PEND:		break;	default:		del_cid(frm->in, dcid, scid);		break;	}	if (p_filter(FILT_L2CAP))		return;	printf("Connect rsp: dcid 0x%4.4x scid 0x%4.4x result %d status %d\n",		dcid, scid, result, status);	p_indent(level + 1, frm);	printf("%s", connresult2str(result));	if (result == 0x0001)		printf(" - %s\n", status2str(status));	else		printf("\n");}static void conf_opt(int level, void *ptr, int len, int in, uint16_t cid){	p_indent(level, 0);	while (len > 0) {		l2cap_conf_opt *h = ptr;		uint8_t mode;		ptr += L2CAP_CONF_OPT_SIZE + h->len;		len -= L2CAP_CONF_OPT_SIZE + h->len;		if (h->type & 0x80)			printf("[");		switch (h->type & 0x7f) {		case L2CAP_CONF_MTU:			printf("MTU");			if (h->len > 0)				printf(" %d", get_val(h->val, h->len));			break;		case L2CAP_CONF_FLUSH_TO:			printf("FlushTO");			if (h->len > 0)				printf(" %d", get_val(h->val, h->len));			break;		case L2CAP_CONF_QOS:			printf("QoS");			if (h->len > 0)				printf(" 0x%02x (%s)", *(h->val + 1), type2str(*(h->val + 1)));			break;		case L2CAP_CONF_RFC:			printf("Mode");			if (h->len > 0) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆精品一区二区| 色哟哟国产精品| 日本不卡123| 一区二区三区在线看| 亚洲国产精品99久久久久久久久| 欧美一区二区三区系列电影| 91福利在线导航| 国产一区高清在线| 久久精品国产免费看久久精品| 亚洲综合小说图片| 一区二区三区四区在线播放 | 国产女人18毛片水真多成人如厕| 日本美女一区二区三区| 亚洲国产精品久久久久婷婷884 | 日本在线不卡视频| 午夜激情一区二区| 奇米影视一区二区三区小说| 日本亚洲三级在线| 激情文学综合丁香| www..com久久爱| 在线中文字幕不卡| 日韩视频免费观看高清完整版 | 国产一区二区三区四| 国产精品77777| 99久久婷婷国产精品综合| 色呦呦一区二区三区| 欧美特级限制片免费在线观看| 欧美日韩国产精选| 精品国产乱码久久久久久闺蜜| 国产欧美一区二区精品性色 | 亚洲免费三区一区二区| 亚洲成人免费影院| 国内精品国产三级国产a久久| 国产91丝袜在线18| 在线视频国内自拍亚洲视频| 欧美一卡二卡在线观看| 中文字幕av一区二区三区免费看 | 午夜精品视频一区| 激情另类小说区图片区视频区| 成人黄色免费短视频| 欧美日韩亚州综合| 久久网站最新地址| 亚洲激情图片小说视频| 蜜臀国产一区二区三区在线播放 | 欧美韩国日本一区| 亚洲国产精品自拍| 国产精品一卡二| 欧美日韩国产在线播放网站| 久久精品亚洲国产奇米99| 一区二区三区四区激情| 国产伦理精品不卡| 久久国产婷婷国产香蕉| 天天色图综合网| 成人av免费在线| 欧美一区二区三区色| 国产精品久久午夜夜伦鲁鲁| 性感美女极品91精品| 粉嫩av亚洲一区二区图片| 欧美精品久久久久久久多人混战| 欧美国产在线观看| 日韩福利电影在线| 色一情一乱一乱一91av| 久久综合精品国产一区二区三区 | 五月天激情综合| 国产电影一区二区三区| 欧美肥妇毛茸茸| 依依成人综合视频| 国产成人精品亚洲午夜麻豆| 这里只有精品电影| 亚洲伊人色欲综合网| 成人av网站免费观看| 久久综合色播五月| 日产精品久久久久久久性色| 色综合一个色综合| 国产欧美日韩在线看| 美国一区二区三区在线播放| 欧美专区日韩专区| 亚洲视频一区二区在线| 国产a视频精品免费观看| 欧美一区二区三区播放老司机| 日韩码欧中文字| 懂色av中文一区二区三区| 欧美一级视频精品观看| 亚洲香肠在线观看| 99久久婷婷国产综合精品电影| 久久先锋资源网| 精品写真视频在线观看 | 一区二区免费在线| 99久免费精品视频在线观看| 国产午夜三级一区二区三| 久久99最新地址| 欧美大片顶级少妇| 日本91福利区| 日韩女优毛片在线| 日本系列欧美系列| 欧美精选一区二区| 亚洲电影你懂得| 欧美午夜精品一区二区三区| 亚洲激情图片一区| 色婷婷精品久久二区二区蜜臀av| 亚洲欧洲国产专区| aaa欧美日韩| 17c精品麻豆一区二区免费| 99热这里都是精品| 一区二区三区日韩精品| 欧美在线小视频| 偷拍日韩校园综合在线| 欧美电影影音先锋| 免费观看久久久4p| 精品久久一区二区三区| 国产精品18久久久久久久网站| 久久久无码精品亚洲日韩按摩| 国产一区二区影院| 国产欧美一区二区精品忘忧草| 大胆欧美人体老妇| 日韩理论在线观看| 色嗨嗨av一区二区三区| 亚洲成av人片一区二区三区| 欧美一区二区精品久久911| 精品系列免费在线观看| 国产亚洲一本大道中文在线| 成人h动漫精品一区二区| 亚洲视频一区在线观看| 欧美日本在线播放| 国产在线播放一区| 中文字幕一区在线观看| 91搞黄在线观看| 蜜臀av性久久久久蜜臀aⅴ流畅| 2021中文字幕一区亚洲| 成人免费三级在线| 一区二区三区欧美视频| 欧美一区二区三区免费视频| 国产精品一区二区在线播放| 中文字幕一区二区三区不卡在线| 欧美色偷偷大香| 蓝色福利精品导航| 中文字幕五月欧美| 欧美日韩国产首页| 国产一区在线视频| 成人免费小视频| 欧美一区二区三区精品| 成人va在线观看| 日韩精品电影在线| 欧美激情中文字幕| 欧美精选午夜久久久乱码6080| 国产在线不卡一区| 亚洲一区av在线| 久久你懂得1024| 欧美日韩中文一区| 国产福利一区二区三区视频在线| 亚洲精品伦理在线| 日韩午夜电影av| 91久久线看在观草草青青| 久久久久久夜精品精品免费| 一区二区三区精密机械公司| 日韩欧美专区在线| 波多野结衣欧美| 久久精品国产在热久久| 亚洲六月丁香色婷婷综合久久| 日韩免费视频一区二区| 97久久精品人人爽人人爽蜜臀| 久久免费精品国产久精品久久久久 | 免费在线观看一区| 国产精品久久午夜| 精品国产一区二区三区久久影院| 91热门视频在线观看| 精品一区二区三区久久| 性做久久久久久久免费看| 国产精品久久久久一区二区三区 | 久久亚洲精品国产精品紫薇| 色狠狠一区二区| 成人听书哪个软件好| 国产在线播精品第三| 男女男精品视频| 一区二区三区蜜桃| 综合色中文字幕| 国产日韩av一区| 日韩精品专区在线| 在线不卡一区二区| 91福利视频在线| 一本在线高清不卡dvd| 国产乱色国产精品免费视频| 日本中文在线一区| 亚洲成人综合在线| 亚洲综合清纯丝袜自拍| 成人欧美一区二区三区视频网页| 久久久99精品免费观看| 日韩免费视频一区| 7777精品伊人久久久大香线蕉完整版| 91国模大尺度私拍在线视频| 99精品偷自拍| 91原创在线视频| 北条麻妃一区二区三区| 懂色av中文一区二区三区| 国产精品中文字幕日韩精品 | 欧美日韩第一区日日骚| 91精品办公室少妇高潮对白| 91麻豆国产精品久久| 99久久精品国产一区| 99久久国产综合精品麻豆|