| Here's a starter DCL hack to detect multiple hardware addresses using the same
hardware address. This script assumes that you've had the configurator module
running and listening long enough to get a decent picture of the network.
Try it out. If you think this is useful, then just bag on the extra line of DCL
to send a Data Collector event & you now have duplicate address detection for
DECnet.
/doug
$! CHECK_DUP.COM: detect duplicate physical addresses via configurator module
$! Doug McPherson 11-sep-1992 (creation)
$!
$ time_start = f$cvtime(,,"time")
$ if f$search("ether.out") .nes. "" then rename ether.out ether.old
$ write sys$output "Dumping configurator data..."
$ ncp sho module configurator kn circ char to ether.out
$!
$ if f$search("pair1.out") .nes. "" then rename pair1.out pair1.old
$ write sys$output "Thinning out the configurator data file..."
$ search ether.out "Physical address","Hardware address" /out=pair1.out
$!
$!Need to re-format the search output to include the physical address and
$!hardware address for each system on a single line (currently stored as adjacent
$!separate lines in the file).
$! PHYSICAL_ADDR1
$! HARD_ADDR1
$! PHYSICAL_ADDR2
$! HARD_ADDR2
$! PHYSICAL_ADDR3
$! HARD_ADDR3
$!
$!They will be formatted into single line, comma-delimited records. E.g.
$! PHYSICAL_ADDR1,HARD_ADDR1
$! PHYSICAL_ADDR2,HARD_ADDR2
$! PHYSICAL_ADDR3,HARD_ADDR3
$!
$ if f$search("pair2.out") .nes. "" then rename pair2.out pair2.old
$!
$ write sys$output "Formatting the configurator data file..."
$ open/write outfile pair2.out
$ open/read infile pair1.out
$ read infile line
$
$read_loop:
$ read/end = done1/err=done infile phys_line
$ read/end = done1/err=done infile hard_line
$ phys_addr = f$extract(27,17,phys_line)
$ hard_addr = f$extract(27,17,hard_line)
$ write outfile hard_addr, ",", phys_addr
$ goto read_loop
$!
$done1:
$ close infile
$ close outfile
$!
$! *Now* sort the file (using physical address as the key)
$!
$ if f$search("pair3.out") .nes. "" then rename pair3.out pair3.old
$ write sys$output "Sorting the formatted data..."
$ sort pair2.out pair3.out
$
$ write sys$output "Now scanning for duplicate physical addresses..."
$ open/read infile pair3.out
$ read infile line
$ this_phys_addr = f$extract(0,f$locate(",",line),line)
$ this_hard_addr = f$extract(f$locate(",",line)+1,18,line)
$
$ write sys$output "These Physical addresses were advertised by hardware addresses as of ''f$time()'"
$ write sys$output "Physical Address Hardware Addresses DECnet Address"
$!write sys$output "xx-xx-xx-xx-xx-xx xx-xx-xx-xx-xx-xx, xx-xx-xx-xx-xx-xx
$ write sys$output "--------------------------------------------------------------------------"
$read_loop:
$ read/end = done/err=done infile next_line
$ next_phys_addr = f$extract(0,f$locate(",",next_line),next_line)
$ next_hard_addr = f$extract(f$locate(",",next_line)+1,18,next_line)
$ if this_phys_addr .eqs. next_phys_addr
$ then
$ hi_byte = f$extract(12,2,this_phys_addr)
$ lo_byte = f$extract(15,2,this_phys_addr)
$ hex_decnet = lo_byte+hi_byte
$ decnet_addr = f$string((%x'hex_decnet/1024)) + "." + f$string((%x'hex_decnet-(%x'hex_decnet/1024)*1024))
$
$ write sys$output "''this_phys_addr' ''this_hard_addr', ''next_hard_addr' ''decnet_addr'"
$
$ endif
$ this_phys_addr = next_phys_addr
$ this_hard_addr = next_hard_addr
$ goto read_loop
$!
$done:
$ close infile
$ write sys$output "Elapsed time: ",f$cvtime("-''time_start'",,"time")
$ exit
|
| some output from the procedure in -.1 here at LKG...
MCDOUG>> @check_dup.com
Dumping configurator data...
Thinning out the configurator data file...
Formatting the configurator data file...
Sorting the formatted data...
Now scanning for duplicate physical addresses...
These Physical addresses were advertised by hardware addresses as of 11-SEP-1992 14:40:37.00
Physical Address Hardware Addresses DECnet Address
--------------------------------------------------------------------------
AA-00-04-00-01-FC 08-00-2B-1B-0B-D2, AA-00-03-01-3E-FF 63.1
AA-00-04-00-15-FC 08-00-2B-0F-83-0A, 08-00-2B-23-BE-D8 63.21
AA-00-04-00-1F-F9 08-00-2B-1A-64-B9, 08-00-2B-1D-2A-EF 62.287
AA-00-04-00-27-10 08-00-2B-0A-0A-71, 08-00-2B-24-22-90 4.39
AA-00-04-00-36-12 08-00-2B-05-A8-C6, 08-00-2B-1B-7A-53 4.566
AA-00-04-00-37-12 08-00-2B-04-E2-4B, 08-00-2B-07-E1-B3 4.567
AA-00-04-00-3F-DC 08-00-2B-0C-B7-15, 08-00-2B-0D-A4-87 55.63
AA-00-04-00-40-10 08-00-2B-0B-F6-3D, 08-00-2B-1A-07-F5 4.64
AA-00-04-00-4D-10 08-00-2B-11-58-A3, 08-00-2B-12-A9-83 4.77
AA-00-04-00-53-12 08-00-2B-07-E2-C4, 08-00-2B-1B-7B-41 4.595
AA-00-04-00-76-10 08-00-2B-15-3C-00, 08-00-2B-2B-08-A9 4.118
AA-00-04-00-80-DC 08-00-2B-04-AB-73, 08-00-2B-0C-40-C3 55.128
AA-00-04-00-DC-FD 08-00-2B-0C-82-1F, 08-00-2B-17-B0-AD 63.476
Elapsed time: 00:11:10.42
MCDOUG>>
|