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
[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
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
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
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