2008-12-10 15:13:46

by Keir

[permalink] [raw]
Subject: Listing established mesh connections

Hi,

I was wondering if there was an efficient way to get a list of
established mesh connections for a given mesh network? I'm working on
a custom link metric (Packet pair) for the o11s stack and want to
unicast a packet to each established connection. I have been reading
through the HWMP code, but it doesn't seem clear to me how this code
gets a list of its neighbors.

Cheers

Keir


2008-12-11 13:55:53

by Johannes Berg

[permalink] [raw]
Subject: Re: Listing established mesh connections

[dropping o11s list, keeps telling me it drops my mail]

On Thu, 2008-12-11 at 11:14 +0000, Keir wrote:
> Hi,
>
> No, I mean I want to do this within the C code of the mesh stack.

Oh. Well, is that what you want? If it is, then you can iterate the
sta_info list in the stack and check the sdata.

johannes


Attachments:
signature.asc (836.00 B)
This is a digitally signed message part

2008-12-10 15:29:26

by Johannes Berg

[permalink] [raw]
Subject: Re: Listing established mesh connections

On Wed, 2008-12-10 at 15:13 +0000, Keir wrote:
> Hi,
>
> I was wondering if there was an efficient way to get a list of
> established mesh connections for a given mesh network? I'm working on
> a custom link metric (Packet pair) for the o11s stack and want to
> unicast a packet to each established connection. I have been reading
> through the HWMP code, but it doesn't seem clear to me how this code
> gets a list of its neighbors.

I think "iw dev wlan0 station dump" will give you what you want?

johannes


Attachments:
signature.asc (836.00 B)
This is a digitally signed message part

2008-12-11 14:12:57

by Johannes Berg

[permalink] [raw]
Subject: Re: Listing established mesh connections

On Thu, 2008-12-11 at 14:55 +0100, Johannes Berg wrote:
> [dropping o11s list, keeps telling me it drops my mail]
>
> On Thu, 2008-12-11 at 11:14 +0000, Keir wrote:
> > Hi,
> >
> > No, I mean I want to do this within the C code of the mesh stack.
>
> Oh. Well, is that what you want? If it is, then you can iterate the
> sta_info list in the stack and check the sdata.

I mean, if that command prints what you want then you can easily
reproduce the same list in the kernel.

johannes


Attachments:
signature.asc (836.00 B)
This is a digitally signed message part

2008-12-11 17:05:41

by Johannes Berg

[permalink] [raw]
Subject: Re: Listing established mesh connections

On Thu, 2008-12-11 at 14:39 +0000, Keir wrote:
> Yea I had that thought, but I wasn't sure how many items there would
> be in that list, or whether there was a less than linear time way to
> do it. I did look into the IW code, but i found it quite hard to
> follow through that back into libnl and from there back into the
> kernel.

Well, it's pretty much

rcu_read_lock()
list_for_each_entry_rcu(sta, &local->sta_list) {
if (sta->sdata != mesh_sdata)
continue;
do something with sta
}
rcu_read_unlock();

I'd think.

johannes


Attachments:
signature.asc (836.00 B)
This is a digitally signed message part