You could test the operating system type using the Perl special variable $^O
and compare it to the list of operating systems provided in the Perl online
docs under "Perlport". If NT then use NBSTAT or some other method. If UNIX
use "ifconfig" and parse the out put. I'm pretty sure the ETHERS parameter
in there is the MAC address. I'm not aware of an existing module but there
very well could be one.
Hope this helps.
uname $^O $Config{'archname'}
--------------------------------------------
AIX aix aix
BSD/OS bsdos i386-bsdos
dgux dgux AViiON-dgux
DYNIX/ptx dynixptx i386-dynixptx
FreeBSD freebsd freebsd-i386
Linux linux arm-linux
Linux linux i386-linux
Linux linux i586-linux
Linux linux ppc-linux
HP-UX hpux PA-RISC1.1
IRIX irix irix
Mac OS X rhapsody rhapsody
MachTen PPC machten powerpc-machten
NeXT 3 next next-fat
NeXT 4 next OPENSTEP-Mach
openbsd openbsd i386-openbsd
OSF1 dec_osf alpha-dec_osf
reliantunix-n svr4 RM400-svr4
SCO_SV sco_sv i386-sco_sv
SINIX-N svr4 RM400-svr4
sn4609 unicos CRAY_C90-unicos
sn6521 unicosmk t3e-unicosmk
sn9617 unicos CRAY_J90-unicos
SunOS solaris sun4-solaris
SunOS solaris i86pc-solaris
SunOS4 sunos sun4-sunos
Kind regards,
Trevor J. Joerges
--------------------------------------------
$_=q;rrUSFWPSZK.ZKPFSHFT,rkvtuZbopuifsZQZibdl
rrqpxfsfeZcyZQ,,riuuq://xxx.%.dpn,ru~@%.dpn ,rrr8-)
;;s;\~;kpfshft;g;s;\%;tfoenjnf;g;y;B-x;A-w;;
s;P;perl;g;s;,;\n;g;s;Y; ;g;s;q;\t;g;print;
--------------------------------------------
----- Original Message -----
From: "Eyrich, Christian" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 24, 2002 1:11 PM
Subject: IP -> MAC-Address
| Hello,
|
| I want to know from a IP-Addres the MAC-Address.
|
| 10.14.146.225 00-10-83-f3-42-42
|
|
| With the DOS-Command "nbtstat" I can retrieve the MAC but I have
| Suns and Apple Boxes too, and then this command will not work.
| I am using NT4 with SP6 and Perl v5.6.1 633, knows somebody
| if there is any Standart Module avaible or something else?
|
|
| bye
| chris
|
|
| _______________________________________________
| ActivePerl mailing list
| [EMAIL PROTECTED]
| To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
|
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs