+++ /dev/null
-commit 11dbefe49d06185e4c7248715d58c6550cd399da
-Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
-Date: Tue Jan 31 17:25:34 2012 -0800
-
- btio: Add L2ERTM type
-
- L2ERTM type uses L2CAP socket in SOCK_STREAM instead of SOCK_SEQPACKET
-
-diff --git a/btio/btio.c b/btio/btio.c
-index 825907d..9781ec4 100644
---- a/btio/btio.c
-+++ b/btio/btio.c
-@@ -1161,6 +1161,7 @@ static gboolean get_valist(GIOChannel *io, BtIOType type, GError **err,
- switch (type) {
- case BT_IO_L2RAW:
- case BT_IO_L2CAP:
-+ case BT_IO_L2ERTM:
- return l2cap_get(sock, err, opt1, args);
- case BT_IO_RFCOMM:
- return rfcomm_get(sock, err, opt1, args);
-@@ -1223,6 +1224,7 @@ gboolean bt_io_set(GIOChannel *io, BtIOType type, GError **err,
- switch (type) {
- case BT_IO_L2RAW:
- case BT_IO_L2CAP:
-+ case BT_IO_L2ERTM:
- return l2cap_set(sock, opts.sec_level, opts.imtu, opts.omtu,
- opts.mode, opts.master, opts.flushable,
- opts.priority, err);
-@@ -1283,6 +1285,20 @@ static GIOChannel *create_io(BtIOType type, gboolean server,
- opts->priority, err))
- goto failed;
- break;
-+ case BT_IO_L2ERTM:
-+ sock = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_L2CAP);
-+ if (sock < 0) {
-+ ERROR_FAILED(err, "socket(STREAM, L2CAP)", errno);
-+ return NULL;
-+ }
-+ if (l2cap_bind(sock, &opts->src, server ? opts->psm : 0,
-+ opts->cid, err) < 0)
-+ goto failed;
-+ if (!l2cap_set(sock, opts->sec_level, opts->imtu, opts->omtu,
-+ opts->mode, opts->master, opts->flushable,
-+ opts->priority, err))
-+ goto failed;
-+ break;
- case BT_IO_RFCOMM:
- sock = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
- if (sock < 0) {
-@@ -1353,6 +1369,7 @@ GIOChannel *bt_io_connect(BtIOType type, BtIOConnect connect,
- err = l2cap_connect(sock, &opts.dst, 0, opts.cid);
- break;
- case BT_IO_L2CAP:
-+ case BT_IO_L2ERTM:
- err = l2cap_connect(sock, &opts.dst, opts.psm, opts.cid);
- break;
- case BT_IO_RFCOMM:
-diff --git a/btio/btio.h b/btio/btio.h
-index 7e3e130..126d5d9 100644
---- a/btio/btio.h
-+++ b/btio/btio.h
-@@ -40,6 +40,7 @@ GQuark bt_io_error_quark(void);
- typedef enum {
- BT_IO_L2RAW,
- BT_IO_L2CAP,
-+ BT_IO_L2ERTM,
- BT_IO_RFCOMM,
- BT_IO_SCO,
- } BtIOType;
+++ /dev/null
-commit 51886914ef77f6c7331347a5e023cf8cde65629c
-Author: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
-Date: Tue Jan 24 10:57:19 2012 -0300
-
- btio: Add support for getting the Encryption Key Size via btio
-
- Some profiles specify some restriction depending on the length
- of the key used to encrypt the link, this adds an way to retrieve
- that value from the kernel.
-
-diff --git a/btio/btio.c b/btio/btio.c
-index a45a9cc..77ddb1d 100644
---- a/btio/btio.c
-+++ b/btio/btio.c
-@@ -511,6 +511,21 @@ static int set_priority(int sock, uint32_t prio)
- return 0;
- }
-
-+static gboolean get_key_size(int sock, int *size, GError **err)
-+{
-+ struct bt_security sec;
-+ socklen_t len;
-+
-+ memset(&sec, 0, sizeof(sec));
-+ len = sizeof(sec);
-+ if (getsockopt(sock, SOL_BLUETOOTH, BT_SECURITY, &sec, &len) == 0) {
-+ *size = sec.key_size;
-+ return TRUE;
-+ }
-+
-+ return FALSE;
-+}
-+
- static gboolean l2cap_set(int sock, int sec_level, uint16_t imtu,
- uint16_t omtu, uint8_t mode, int master,
- int flushable, uint32_t priority, GError **err)
-@@ -875,6 +890,10 @@ static gboolean l2cap_get(int sock, GError **err, BtIOOption opt1,
- va_arg(args, int *), err))
- return FALSE;
- break;
-+ case BT_IO_OPT_KEY_SIZE:
-+ if (!get_key_size(sock, va_arg(args, int *), err))
-+ return FALSE;
-+ break;
- case BT_IO_OPT_PSM:
- *(va_arg(args, uint16_t *)) = src.l2_psm ?
- btohs(src.l2_psm) : btohs(dst.l2_psm);
-diff --git a/btio/btio.h b/btio/btio.h
-index ae55b61..7e3e130 100644
---- a/btio/btio.h
-+++ b/btio/btio.h
-@@ -52,6 +52,7 @@ typedef enum {
- BT_IO_OPT_DEST_BDADDR,
- BT_IO_OPT_DEFER_TIMEOUT,
- BT_IO_OPT_SEC_LEVEL,
-+ BT_IO_OPT_KEY_SIZE,
- BT_IO_OPT_CHANNEL,
- BT_IO_OPT_SOURCE_CHANNEL,
- BT_IO_OPT_DEST_CHANNEL,
+++ /dev/null
-diff -Nur bluez-4.98/src/bluetooth.conf bluez-4.98-new/src/bluetooth.conf
---- bluez-4.98/src/bluetooth.conf 2012-02-21 01:04:03.000000000 -0800
-+++ bluez-4.98-new/src/bluetooth.conf 2012-03-29 06:08:59.676857623 -0700
-@@ -1,104 +1,117 @@
--<?xml version="1.0"?><!--*-nxml-*-->
--
--<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
-- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
--
--<busconfig>
-- <policy user="root">
-- <allow own="org.projectx.bluetooth"/>
-- <allow send_interface="org.projectx.bluetooth"/>
-- <allow send_destination="org.projectx.bluetooth"/>
-- <allow own="org.bluez.frwk_agent"/>
-- <allow send_interface="org.bluez.frwk_agent"/>
-- <allow send_destination="org.bluez.frwk_agent"/>
-- <allow own="org.bluez.Agent"/>
-- <allow send_interface="org.bluez.Agent"/>
-- <allow send_destination="org.bluez.Agent"/>
-- <allow own="org.bluez.Adapter"/>
-- <allow send_interface="org.bluez.Adapter"/>
-- <allow send_destination="org.bluez.Adapter"/>
-- <allow own="org.bluez.Manager"/>
-- <allow send_interface="org.bluez.Manager"/>
-- <allow send_destination="org.bluez.Manager"/>
-- <allow own="org.bluez.Device"/>
-- <allow send_interface="org.bluez.Device"/>
-- <allow send_destination="org.bluez.Device"/>
-- <allow own="org.bluez.Serial"/>
-- <allow send_interface="org.bluez.Serial"/>
-- <allow send_destination="org.bluez.Serial"/>
-- <allow own="org.bluez.SerialProxyManager"/>
-- <allow send_interface="org.bluez.SerialProxyManager"/>
-- <allow send_destination="org.bluez.SerialProxyManager"/>
-- <allow own="org.bluez.SerialProxy"/>
-- <allow send_interface="org.bluez.SerialProxy"/>
-- <allow send_destination="org.bluez.SerialProxy"/>
-- <allow own="org.bluez.NetworkServer"/>
-- <allow send_interface="org.bluez.NetworkServer"/>
-- <allow send_destination="org.bluez.NetworkServer"/>
-- <allow own="org.bluez.Network"/>
-- <allow send_interface="org.bluez.Network"/>
-- <allow send_destination="org.bluez.Network"/>
-- <allow own="org.bluez.AudioSink"/>
-- <allow send_interface="org.bluez.AudioSink"/>
-- <allow send_destination="org.bluez.AudioSink"/>
-- <allow own="org.bluez.Input"/>
-- <allow send_interface="org.bluez.Input"/>
-- <allow send_destination="org.bluez.Input"/>
-- </policy>
-- <policy group="bt_use">
-- <allow send_interface="org.projectx.bluetooth"/>
-- <allow send_destination="org.projectx.bluetooth"/>
-- <allow send_interface="org.bluez.frwk_agent"/>
-- <allow send_destination="org.bluez.frwk_agent"/>
-- <allow send_interface="org.bluez.Agent"/>
-- <allow send_destination="org.bluez.Agent"/>
-- <allow send_interface="org.bluez.Adapter"/>
-- <allow send_destination="org.bluez.Adapter"/>
-- <allow send_interface="org.bluez.Manager"/>
-- <allow send_destination="org.bluez.Manager"/>
-- <allow send_interface="org.bluez.Device"/>
-- <allow send_destination="org.bluez.Device"/>
-- <allow send_interface="org.bluez.Serial"/>
-- <allow send_destination="org.bluez.Serial"/>
-- <allow send_interface="org.bluez.SerialProxyManager"/>
-- <allow send_destination="org.bluez.SerialProxyManager"/>
-- <allow send_interface="org.bluez.SerialProxy"/>
-- <allow send_destination="org.bluez.SerialProxy"/>
-- <allow send_interface="org.bluez.NetworkServer"/>
-- <allow send_destination="org.bluez.NetworkServer"/>
-- <allow send_interface="org.bluez.Network"/>
-- <allow send_destination="org.bluez.Network"/>
-- <allow send_interface="org.bluez.AudioSink"/>
-- <allow send_destination="org.bluez.AudioSink"/>
-- <allow send_interface="org.bluez.Input"/>
-- <allow send_destination="org.bluez.Input"/>
-- </policy>
-- <policy context="default">
-- <deny send_interface="org.projectx.bluetooth"/>
-- <deny send_destination="org.projectx.bluetooth"/>
-- <deny send_interface="org.bluez.frwk_agent"/>
-- <deny send_destination="org.bluez.frwk_agent"/>
-- <deny send_interface="org.bluez.Agent"/>
-- <deny send_destination="org.bluez.Agent"/>
-- <deny send_interface="org.bluez.Adapter"/>
-- <deny send_destination="org.bluez.Adapter"/>
-- <deny send_interface="org.bluez.Manager"/>
-- <deny send_destination="org.bluez.Manager"/>
-- <deny send_interface="org.bluez.Device"/>
-- <deny send_destination="org.bluez.Device"/>
-- <deny send_interface="org.bluez.Serial"/>
-- <deny send_destination="org.bluez.Serial"/>
-- <deny send_interface="org.bluez.SerialProxyManager"/>
-- <deny send_destination="org.bluez.SerialProxyManager"/>
-- <deny send_interface="org.bluez.SerialProxy"/>
-- <deny send_destination="org.bluez.SerialProxy"/>
-- <deny send_interface="org.bluez.NetworkServer"/>
-- <deny send_destination="org.bluez.NetworkServer"/>
-- <deny send_interface="org.bluez.Network"/>
-- <deny send_destination="org.bluez.Network"/>
-- <deny send_interface="org.bluez.AudioSink"/>
-- <deny send_destination="org.bluez.AudioSink"/>
-- <deny send_interface="org.bluez.Input"/>
-- <deny send_destination="org.bluez.Input"/>
-- </policy>
--</busconfig>
-+<?xml version="1.0"?><!--*-nxml-*-->\r
-+\r
-+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"\r
-+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">\r
-+\r
-+<busconfig>\r
-+ <policy user="root">\r
-+ <allow own="org.bluez"/>\r
-+ <allow send_destination="org.bluez"/>\r
-+ <allow send_interface="org.bluez.Agent"/>\r
-+ <allow send_interface="org.bluez.HandsfreeAgent"/>\r
-+ <allow send_interface="org.bluez.MediaEndpoint"/>\r
-+ <allow send_interface="org.bluez.MediaPlayer"/>\r
-+ <allow send_interface="org.bluez.Watcher"/>\r
-+ <allow send_interface="org.bluez.ThermometerWatcher"/>\r
-+ <allow own="org.projectx.bluetooth"/>\r
-+ <allow send_interface="org.projectx.bluetooth"/>\r
-+ <allow send_destination="org.projectx.bluetooth"/>\r
-+ <allow own="org.bluez.frwk_agent"/>\r
-+ <allow send_interface="org.bluez.frwk_agent"/>\r
-+ <allow send_destination="org.bluez.frwk_agent"/>\r
-+ <allow own="org.bluez.Agent"/>\r
-+ <allow send_interface="org.bluez.Agent"/>\r
-+ <allow send_destination="org.bluez.Agent"/>\r
-+ <allow own="org.bluez.Adapter"/>\r
-+ <allow send_interface="org.bluez.Adapter"/>\r
-+ <allow send_destination="org.bluez.Adapter"/>\r
-+ <allow own="org.bluez.Manager"/>\r
-+ <allow send_interface="org.bluez.Manager"/>\r
-+ <allow send_destination="org.bluez.Manager"/>\r
-+ <allow own="org.bluez.Device"/>\r
-+ <allow send_interface="org.bluez.Device"/>\r
-+ <allow send_destination="org.bluez.Device"/>\r
-+ <allow own="org.bluez.Serial"/>\r
-+ <allow send_interface="org.bluez.Serial"/>\r
-+ <allow send_destination="org.bluez.Serial"/>\r
-+ <allow own="org.bluez.SerialProxyManager"/>\r
-+ <allow send_interface="org.bluez.SerialProxyManager"/>\r
-+ <allow send_destination="org.bluez.SerialProxyManager"/>\r
-+ <allow own="org.bluez.SerialProxy"/>\r
-+ <allow send_interface="org.bluez.SerialProxy"/>\r
-+ <allow send_destination="org.bluez.SerialProxy"/>\r
-+ <allow own="org.bluez.NetworkServer"/>\r
-+ <allow send_interface="org.bluez.NetworkServer"/>\r
-+ <allow send_destination="org.bluez.NetworkServer"/>\r
-+ <allow own="org.bluez.Network"/>\r
-+ <allow send_interface="org.bluez.Network"/>\r
-+ <allow send_destination="org.bluez.Network"/>\r
-+ <allow own="org.bluez.AudioSink"/>\r
-+ <allow send_interface="org.bluez.AudioSink"/>\r
-+ <allow send_destination="org.bluez.AudioSink"/>\r
-+ <allow own="org.bluez.Input"/>\r
-+ <allow send_interface="org.bluez.Input"/>\r
-+ <allow send_destination="org.bluez.Input"/>\r
-+ </policy>\r
-+ <policy group="bt_use">\r
-+ <allow send_destination="org.bluez"/>\r
-+ <allow send_interface="org.projectx.bluetooth"/>\r
-+ <allow send_destination="org.projectx.bluetooth"/>\r
-+ <allow send_interface="org.bluez.frwk_agent"/>\r
-+ <allow send_destination="org.bluez.frwk_agent"/>\r
-+ <allow send_interface="org.bluez.Agent"/>\r
-+ <allow send_destination="org.bluez.Agent"/>\r
-+ <allow send_interface="org.bluez.Adapter"/>\r
-+ <allow send_destination="org.bluez.Adapter"/>\r
-+ <allow send_interface="org.bluez.Manager"/>\r
-+ <allow send_destination="org.bluez.Manager"/>\r
-+ <allow send_interface="org.bluez.Device"/>\r
-+ <allow send_destination="org.bluez.Device"/>\r
-+ <allow send_interface="org.bluez.Serial"/>\r
-+ <allow send_destination="org.bluez.Serial"/>\r
-+ <allow send_interface="org.bluez.SerialProxyManager"/>\r
-+ <allow send_destination="org.bluez.SerialProxyManager"/>\r
-+ <allow send_interface="org.bluez.SerialProxy"/>\r
-+ <allow send_destination="org.bluez.SerialProxy"/>\r
-+ <allow send_interface="org.bluez.NetworkServer"/>\r
-+ <allow send_destination="org.bluez.NetworkServer"/>\r
-+ <allow send_interface="org.bluez.Network"/>\r
-+ <allow send_destination="org.bluez.Network"/>\r
-+ <allow send_interface="org.bluez.AudioSink"/>\r
-+ <allow send_destination="org.bluez.AudioSink"/>\r
-+ <allow send_interface="org.bluez.Input"/>\r
-+ <allow send_destination="org.bluez.Input"/>\r
-+ </policy>\r
-+ <policy context="default">\r
-+ <deny send_destination="org.bluez"/>\r
-+ <deny send_interface="org.projectx.bluetooth"/>\r
-+ <deny send_destination="org.projectx.bluetooth"/>\r
-+ <deny send_interface="org.bluez.frwk_agent"/>\r
-+ <deny send_destination="org.bluez.frwk_agent"/>\r
-+ <deny send_interface="org.bluez.Agent"/>\r
-+ <deny send_destination="org.bluez.Agent"/>\r
-+ <deny send_interface="org.bluez.Adapter"/>\r
-+ <deny send_destination="org.bluez.Adapter"/>\r
-+ <deny send_interface="org.bluez.Manager"/>\r
-+ <deny send_destination="org.bluez.Manager"/>\r
-+ <deny send_interface="org.bluez.Device"/>\r
-+ <deny send_destination="org.bluez.Device"/>\r
-+ <deny send_interface="org.bluez.Serial"/>\r
-+ <deny send_destination="org.bluez.Serial"/>\r
-+ <deny send_interface="org.bluez.SerialProxyManager"/>\r
-+ <deny send_destination="org.bluez.SerialProxyManager"/>\r
-+ <deny send_interface="org.bluez.SerialProxy"/>\r
-+ <deny send_destination="org.bluez.SerialProxy"/>\r
-+ <deny send_interface="org.bluez.NetworkServer"/>\r
-+ <deny send_destination="org.bluez.NetworkServer"/>\r
-+ <deny send_interface="org.bluez.Network"/>\r
-+ <deny send_destination="org.bluez.Network"/>\r
-+ <deny send_interface="org.bluez.AudioSink"/>\r
-+ <deny send_destination="org.bluez.AudioSink"/>\r
-+ <deny send_interface="org.bluez.Input"/>\r
-+ <deny send_destination="org.bluez.Input"/>\r
-+ </policy>\r
-+ <policy user="pulse">\r
-+ <allow send_destination="org.bluez"/>\r
-+ </policy>\r
-+</busconfig>\r