From: Alexandros Karypidis <karypid@inf.uth.gr>
To: Max Krasnyansky <maxk@qualcomm.com>, bluez-devel@lists.sourceforge.net
Subject: Re: [Bluez-devel] Re: [Bluez-users] How do I obtain a free PSM automatically?
Date: Tue, 11 Feb 2003 18:30:51 +0200 [thread overview]
Message-ID: <200302111830.51716.karypid@inf.uth.gr> (raw)
In-Reply-To: <5.1.0.14.2.20030210125138.04183f58@mail1.qualcomm.com>
On Monday 10 February 2003 23:13, Max Krasnyansky wrote:
> At 06:14 PM 2/8/2003 +0200, Alexandros Karypidis wrote:
> >BTW, it dawned on me that:
> >
> >1) connect() succeeds even if bind() wasn't previously called for the
> > client socket.
> >2) accept() also produces a new socket.
> >
> >I assumed that these operations evidently select a free PSM for the
> > sockets they use/produce. I could not find any such thing in the code
> > however (but I don't really know the BlueZ code).
> >
> >Then, I did the simple tests of:
> >
> >A. Calling getsockname() after a connect() with no previous bind()
> >B. Calling getsockname() after a accept()
> >
> >Case A reported PSM zero (0) !!! This is clearly a bug!
>
> No it's _not_.
> L2CAP PSM != TCP/UDP port. Although it may look like it's the same thing.
> It's not.
Ok, I get this now.
> [...]
> L2CAP PSM identifies a protocol or a service. CID identifies a logical
> channel. Since both client and server sockets use the _same_ protocol they
> must have the same PSM.
>
> TCP/UDP
> [client port]:[client IP] ---> [server port]:[server IP]
>
> L2CAP
> [service PSM]:[client CID] ---> [service PSM]:[server CID]
>
> See the difference ?
> Don't ask me why L2CAP designers didn't stick to common port concept.
> Bluetooth spec is full of "innovations" ;-).
Ok. The problem with this design from my viewpoint is that this design assumes
that a service always uses the same PSM. It assumes that there is no reason
why I would not want to run the service on PSM A at one point and some time
later on PSM B. More specifically, it assumes that I may not even care which
PSM I will be providing the service from, as I might use some "other means"
to coordinate this with clients (see my previous e-mail).
> So the current code is correct.
>
> Now if people really want dynamic PSMs. We could introduce something like
> bind(psm == 0xffff).
As Marcel already pointed out, this would not adhere to the specs... :(
I think dynamic PSMs are a good idea. The add capability. If only there is a
way to add them without "breaking" anything it may be worth doing so! Anyway,
I'm not trying to insist too much or anything -- I'm just throwing around
some ideas which make sense to me.
--
To err is human, but to forgive is beyond the scope of the Operating System...
Alexandros Karypidis
University of Thessaly
Computer & Communications Engineering dept.
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next prev parent reply other threads:[~2003-02-11 16:30 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200302071951.35073.karypid@inf.uth.gr>
[not found] ` <1044653120.32671.4.camel@pegasus.local>
2003-02-08 11:42 ` [Bluez-users] How do I obtain a free PSM automatically? Stephen Crane
[not found] ` <200302072329.21333.karypid@inf.uth.gr>
[not found] ` <1044653775.32672.14.camel@pegasus.local>
2003-02-08 15:40 ` Alexandros Karypidis
2003-02-08 16:14 ` [Bluez-devel] " Alexandros Karypidis
2003-02-10 21:13 ` Max Krasnyansky
2003-02-11 12:01 ` Marcel Holtmann
2003-02-11 17:26 ` Alexandros Karypidis
2003-02-11 17:52 ` Maksim Yevmenkin
2003-02-11 18:58 ` Max Krasnyansky
2003-02-11 18:06 ` Max Krasnyansky
2003-02-17 14:12 ` Marcel Holtmann
2003-02-18 21:06 ` Max Krasnyansky
2003-02-18 23:00 ` Marcel Holtmann
2003-02-19 20:04 ` Max Krasnyansky
2003-02-11 16:30 ` Alexandros Karypidis [this message]
2003-02-10 20:49 ` Max Krasnyansky
2003-02-11 16:22 ` Alexandros Karypidis
2003-02-11 18:04 ` [Bluez-devel] " Maksim Yevmenkin
2003-02-11 18:52 ` Max Krasnyansky
2003-02-11 20:01 ` Maksim Yevmenkin
2003-02-11 21:09 ` Max Krasnyansky
2003-02-11 18:23 ` [Bluez-devel] Re: [Bluez-users] " Max Krasnyansky
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=200302111830.51716.karypid@inf.uth.gr \
--to=karypid@inf.uth.gr \
--cc=bluez-devel@lists.sourceforge.net \
--cc=maxk@qualcomm.com \
/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