From: <rad...@us...> - 2007-02-16 10:37:55
|
Revision: 536 http://svn.sourceforge.net/magicmap/?rev=536&view=rev Author: radetzki09 Date: 2007-02-16 02:37:27 -0800 (Fri, 16 Feb 2007) Log Message: ----------- forget a return ;-) now we get the right MAC-Address Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/net/MacOSNetworkInfo.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/net/MacOSNetworkInfo.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/net/MacOSNetworkInfo.java 2007-02-16 10:04:27 UTC (rev 535) +++ trunk/magicmapclient/src/net/sf/magicmap/client/net/MacOSNetworkInfo.java 2007-02-16 10:37:27 UTC (rev 536) @@ -36,19 +36,18 @@ while (tokenizer.hasMoreTokens()) { String line = tokenizer.nextToken().trim(); + System.out.println("---"+line+"---"); boolean containsLocalHost = line.indexOf(localHost) >= 0; + + if (line.startsWith("inet " + localHost)){ + line = tokenizer.nextToken().trim(); + String macAddressCandidate = line.substring(line.length() - 17).trim(); + if (isMacAddress(macAddressCandidate)) { + lastMacAddress = macAddressCandidate.toUpperCase(); + return lastMacAddress; + } + } - // see if line contains IP address - if (containsLocalHost && lastMacAddress != null) return lastMacAddress; - - // see if line contains MAC address - if (line.indexOf("ether") == -1) continue; - - String macAddressCandidate = line.substring(line.length() - 17).trim(); - if (isMacAddress(macAddressCandidate)) { - lastMacAddress = macAddressCandidate.toUpperCase(); - continue; - } } ParseException ex = new ParseException("cannot read MAC address for " + localHost + " from [" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rad...@us...> - 2007-02-17 08:14:14
|
Revision: 545 http://svn.sourceforge.net/magicmap/?rev=545&view=rev Author: radetzki09 Date: 2007-02-17 00:14:13 -0800 (Sat, 17 Feb 2007) Log Message: ----------- Removed System.out.println() Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/net/MacOSNetworkInfo.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/net/MacOSNetworkInfo.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/net/MacOSNetworkInfo.java 2007-02-17 08:13:34 UTC (rev 544) +++ trunk/magicmapclient/src/net/sf/magicmap/client/net/MacOSNetworkInfo.java 2007-02-17 08:14:13 UTC (rev 545) @@ -36,8 +36,6 @@ while (tokenizer.hasMoreTokens()) { String line = tokenizer.nextToken().trim(); - System.out.println("---"+line+"---"); - boolean containsLocalHost = line.indexOf(localHost) >= 0; if (line.startsWith("inet " + localHost)){ line = tokenizer.nextToken().trim(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rad...@us...> - 2007-03-14 19:42:35
|
Revision: 599 http://svn.sourceforge.net/magicmap/?rev=599&view=rev Author: radetzki09 Date: 2007-03-14 12:39:17 -0700 (Wed, 14 Mar 2007) Log Message: ----------- corrected the parsing of the MAC-Address for the MacOS. Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/net/MacOSNetworkInfo.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/net/MacOSNetworkInfo.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/net/MacOSNetworkInfo.java 2007-03-09 15:00:34 UTC (rev 598) +++ trunk/magicmapclient/src/net/sf/magicmap/client/net/MacOSNetworkInfo.java 2007-03-14 19:39:17 UTC (rev 599) @@ -39,6 +39,9 @@ if (line.startsWith("inet " + localHost)){ line = tokenizer.nextToken().trim(); + while (!line.startsWith("ether")){ + line = tokenizer.nextToken().trim(); + } String macAddressCandidate = line.substring(line.length() - 17).trim(); if (isMacAddress(macAddressCandidate)) { lastMacAddress = macAddressCandidate.toUpperCase(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |