#! /bin/csh -f
#
# shell script to print out the Ethernet repeater address table
# 
# Usage:
#	hubportether <device>
#
#
#We pull out the repeater table, which has the following columns:
#  Column number      Description
#          1          GroupIndex
#          2          Index
#          3          LastSourceAddress
#          4          Number changes
#          5          NewLastSourceAddress

if ($1 == "") then 
   echo "usage:"
   echo "  hubportether <hub-name>"
   exit
else
   echo "Grp Port           Ethernet Addr   # Changes"
   snmptable -v1 -c public -Ov -CHf + -m SNMP-REPEATER-MIB $1 1.3.6.1.2.1.22.3.3.1 |\
      sed -e 's/\"\"/000000000000/g' | \
      sed -e 's/\"//g' | \
      sed -e 's/ //g'  | \
      sed -e 's/+/ /g' | \
      awk '{printf "%3s%5s%24s%12s\n",$1,$2,$3,$4}'
endif
