diff options
author | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2013-05-28 14:45:19 -0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2013-05-29 14:40:05 +0300 |
commit | 4e309bd193ac1babb2c3e0db2f34ab18d208489b (patch) | |
tree | 447a6d024b8bce33fe71e333725c68c8becb84b5 /obexd/plugins | |
parent | d49c6a28add97b386f316eb5262756e84df4d662 (diff) | |
download | bluez-4e309bd193ac1babb2c3e0db2f34ab18d208489b.tar.gz |
bluetooth: add getsockname() entry in the bluetooth driver
Diffstat (limited to 'obexd/plugins')
-rw-r--r-- | obexd/plugins/bluetooth.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/obexd/plugins/bluetooth.c b/obexd/plugins/bluetooth.c index b9e9c91c4..07baf9058 100644 --- a/obexd/plugins/bluetooth.c +++ b/obexd/plugins/bluetooth.c @@ -431,10 +431,29 @@ static int bluetooth_getpeername(GIOChannel *io, char **name) return 0; } +static int bluetooth_getsockname(GIOChannel *io, char **name) +{ + GError *gerr = NULL; + char address[18]; + + bt_io_get(io, &gerr, BT_IO_OPT_SOURCE, address, BT_IO_OPT_INVALID); + + if (gerr) { + error("%s", gerr->message); + g_error_free(gerr); + return -EINVAL; + } + + *name = g_strdup(address); + + return 0; +} + static struct obex_transport_driver driver = { .name = "bluetooth", .start = bluetooth_start, .getpeername = bluetooth_getpeername, + .getsockname = bluetooth_getsockname, .stop = bluetooth_stop }; |