[OpenWrt-Devel] brctl showmacs oneliner

2014-09-26 Thread Gui Iribarren
hello there,
i got bored of manually chasing a mac's location, in a big bridged
batadv network, without "brctl showmacs" command
(cf. http://ask.xmodulo.com/show-mac-learning-table-linux-bridge.html)
(it's not compiled in openwrt's busybox by default for some reason)

so i hacked up a oneliner which perfectly emulates the output

brctl_showmacs () { printf "port no\tmac addr\t\tis local?\tageing
timer\n" ; hexdump -v -e '5/1 "%02x:" /1 "%02x" /1 " %x" /1 " %x" 1/4 "
%i" 1/4 "\n"' /sys/class/net/$1/brforward | awk '{ islocal = $3 ? "yes"
: "no" ; printf "%3i\t%s\t%s\t\t%8.2f\n",$2,$1,islocal,$4/100 }' ; }

i hope this might be useful as is, for someone else reading this list
it can be copypasted in a running node, and used as
# brctl_showmacs br-lan

sample output: http://pastebin.com/

besides that... is there any slight, ugly chance of getting this
"upstream", somewhere?

(maaaybe in /etc/profile alongside these other oneliners?)
[ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; }

or, why is "brctl showmacs" not enabled by default?
(i'm aware it can be enabled by menuconfig in a custom build)

cheers,

gui
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] brctl showmacs oneliner

2014-09-27 Thread Gui Iribarren
On 27/09/14 05:42, Bastian Bittorf wrote:
> * Gui Iribarren  [27.09.2014 10:28]:
>> # brctl_showmacs br-lan
>>
>> sample output: http://pastebin.com/
> 
> i dont get it, please send a proper link 8-)

wow
very true  omg
so distratced   such miss
http://pastebin.com/KZD4AR7K
much sory


> i tried your func on some batman-adv nodes, but with no output.

you must declare it first, then invoke it like "brctl_showmacs br-lan"?

cheers
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel