JDK-4465502 : Low level network methods: It would be nice to get the MAC as "byte[6]"
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2001-06-03
  • Updated: 2001-06-06
  • Resolved: 2001-06-06
Related Reports
Duplicate :  
Description

Name: boT120536			Date: 06/03/2001


(Not relevant)

java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

Hi! I have the following improvement suggestion: I'd like more methods for
access to low level network/OSI information and/or modification...

I can get the host name and IP address through java.net.InetAddress. I'd like a
new class java.net.EthernetAddress, where I should be able to get the MAC
(Media Access Control) address for the network card(s) on the computer.

It is important that I get it in the same format regardless of platform - for
example if I run "ipconfig /all" under Windows, then I get it in the form
of "01-02-03-40-50-60", but if I run "ifconfig -a" under Solaris and look
for "ether", then I get it in the form of "1:2:3:40:50:60" (the numbers are not
zero-padded, and the numbers are separated with ':' instead of '-'). It would
be nice to get the MAC as "byte[6]"...
(Review ID: 125398) 
======================================================================

Comments
WORK AROUND Name: boT120536 Date: 06/03/2001 The workaround is not possible through Java, but I can get the MAC through standard operating system commands (ipconfig /all on Windows, and ifconfig -a on Solaris). Of course, you could run those commands through Java and parse the information, but that requires an implementation for each platform. ======================================================================
11-06-2004

EVALUATION This is a duplicate of 4143901. alan.bateman@ireland 2001-06-06
06-06-2001