Open Source Telephony
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: ofono@ofono.org
Subject: Re: [PATCH v0 5/9] bluez5: Add bt_getsockpeers()
Date: Mon, 28 Jan 2013 16:32:17 +0100	[thread overview]
Message-ID: <1359387137.16748.30.camel@aeonflux> (raw)
In-Reply-To: <1359384259-5384-6-git-send-email-claudio.takahasi@openbossa.org>

[-- Attachment #1: Type: text/plain, Size: 1209 bytes --]

Hi Claudio,

> This patch adds a generic Bluetooth helper function to allow getting
> the adapter and device Bluetooth Address from Bluetooth sockets.
> ---
>  plugins/bluez5.c | 22 ++++++++++++++++++++++
>  plugins/bluez5.h |  3 +++
>  2 files changed, 25 insertions(+)
> 
> diff --git a/plugins/bluez5.c b/plugins/bluez5.c
> index d7e85f2..06629e1 100644
> --- a/plugins/bluez5.c
> +++ b/plugins/bluez5.c
> @@ -52,6 +52,28 @@ int bt_ba2str(const bdaddr_t *ba, char *str)
>  		ba->b[5], ba->b[4], ba->b[3], ba->b[2], ba->b[1], ba->b[0]);
>  }
>  
> +int bt_getsockpeers(int sock, struct sockaddr *src, struct sockaddr *dst,
> +								socklen_t len)
> +{

I really do not get why this is helpful at all. Except for making the
code less readable. So please do not do it. Call the socket functions
directly from where they are used.

In addition the name of this function is totally misleading. It does not
describe at all what it does. The peer is always the remote address. You
are not getting the src and dst peers here. That is not how the socket
nomenclature works. It is either socket name for the local address or
peer name for the remote address.

Regards

Marcel



  reply	other threads:[~2013-01-28 15:32 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-28 14:44 [PATCH v0 0/9] External HFP: Add SCO Claudio Takahasi
2013-01-28 14:44 ` [PATCH v0 1/9] bluez5: Add SCO socket declarations Claudio Takahasi
2013-01-28 14:44 ` [PATCH v0 2/9] bluez5: Add bt_bacpy() Claudio Takahasi
2013-01-28 14:44 ` [PATCH v0 3/9] hfp_hf_bluez5: Add SCO listen socket Claudio Takahasi
2013-01-28 15:59   ` Marcel Holtmann
2013-01-28 16:43     ` Claudio Takahasi
2013-01-28 14:44 ` [PATCH v0 4/9] bluez5: Add bt_ba2str() Claudio Takahasi
2013-01-28 14:44 ` [PATCH v0 5/9] bluez5: Add bt_getsockpeers() Claudio Takahasi
2013-01-28 15:32   ` Marcel Holtmann [this message]
2013-01-28 16:34     ` Claudio Takahasi
2013-01-28 14:44 ` [PATCH v0 6/9] bluez5: Add RFCOMM socket address declaration Claudio Takahasi
2013-01-28 14:44 ` [PATCH v0 7/9] hfp_hf_bluez5: Add rejecting SCO connection Claudio Takahasi
2013-01-28 14:44 ` [PATCH v0 8/9] hfp_hf_bluez5: Reject SCO if source doesn't match Claudio Takahasi
2013-01-28 16:04   ` Marcel Holtmann
2013-01-28 16:56     ` Claudio Takahasi
2013-01-28 14:44 ` [PATCH v0 9/9] hfp_hf_bluez5: Fix missing fd close Claudio Takahasi
2013-01-28 21:11 ` [PATCH v1 0/8] External HFP: Add SCO Claudio Takahasi
2013-01-28 21:11   ` [PATCH v1 1/8] bluez5: Add SCO socket declarations Claudio Takahasi
2013-01-29 14:55     ` Denis Kenzior
2013-01-28 21:11   ` [PATCH v1 2/8] bluez5: Add bt_bacpy() Claudio Takahasi
2013-01-29 14:55     ` Denis Kenzior
2013-01-28 21:11   ` [PATCH v1 3/8] hfp_hf_bluez5: Add SCO listen socket Claudio Takahasi
2013-01-29 15:02     ` Denis Kenzior
2013-01-28 21:11   ` [PATCH v1 4/8] bluez5: Add bt_ba2str() Claudio Takahasi
2013-01-29 15:03     ` Denis Kenzior
2013-01-28 21:11   ` [PATCH v1 5/8] bluez5: Add bt_bacmp() Claudio Takahasi
2013-01-29 15:03     ` Denis Kenzior
2013-01-28 21:11   ` [PATCH v1 6/8] bluez5: Add RFCOMM socket address declaration Claudio Takahasi
2013-01-29 15:04     ` Denis Kenzior
2013-01-28 21:11   ` [PATCH v1 7/8] hfp_hf_bluez5: Add rejecting SCO connection Claudio Takahasi
2013-01-29 15:27     ` Denis Kenzior
2013-01-29 16:17       ` Claudio Takahasi
2013-01-29 16:25         ` Denis Kenzior
2013-01-28 21:11   ` [PATCH v1 8/8] hfp_hf_bluez5: Fix missing fd close Claudio Takahasi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1359387137.16748.30.camel@aeonflux \
    --to=marcel@holtmann.org \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox