Skip to content

Instantly share code, notes, and snippets.

@PitBeast
Created May 13, 2020 07:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save PitBeast/1dea2d9f6d373847194ac010c41ab5dc to your computer and use it in GitHub Desktop.
Save PitBeast/1dea2d9f6d373847194ac010c41ab5dc to your computer and use it in GitHub Desktop.
brforward convertion
brctl_showmacs () {
cat /sys/class/net/$1/brforward > /tmp/brforward ;
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"' /tmp/brforward | awk '{ islocal = $3 ? "yes" : "no" ; printf "%3i\t%s\t%s\t\t%8.2f\n",$2,$1,islocal,$4/100 } ' ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment