🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #1531

Re: ethernet address

#1531
From: Shake
Date: Thu, 22 Nov 2001 14:57
34 lines
1881 bytes
Tim Chemaly wrote:

> I donwloaded this but it could not open the dump file. How does this thing
> work???

you don't need the dump file ... this lib works like tcpdump utility (and it
has an example)

There is another way : http://auditorymodels.org/jcifs/src/jcifs-0.6b2.zip

(www-page: http://auditorymodels.org/jcifs/)

it has NbtAddress class wich allows to get MAC address :

import jcifs.netbios.*;

public class a {

public static void main (String[] aa) {
  try {
   byte[] addr =
NbtAddress.getByName("HOST_NAME_OF_TARGET_MACHINE").getMacAddress();
   /** here you do anything you want  */
  } catch (Exception ex) {ex.printStackTrace();}
}
}

ps: may be you'll need to specify "wins" parameter to get correct MAC address
(java -Dwins10.10.0.1 -cp .;jcifs-0.6b2.jar a)

--
Best wishes
Anton
sshake(a)hotmail.zp.ua
Technical Details
Message-ID: <3BFD124B.C2CC8AFE@hotmail.zp.ua>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!dispose.news.demon.net!demon!diablo.theplanet.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews
References: <3bfb835a_1@dnews> <3BFC22B7.10501@yahoo.com> <3bfc2c17_2@dnews> <3BFCBFE3.940A06A7@hotmail.zp.ua> <3bfcd859_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,c7d3b63fb95818b4
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2001-11-22 07:09:14 PST
Message-ID: <3BFD124B.C2CC8AFE@hotmail.zp.ua>
Date: Thu, 22 Nov 2001 16:57:16 +0200
From: Shake <sshake@hotmail.zp.ua>
Reply-To: sshake@hotmail.zp.ua
X-Mailer: Mozilla 4.72 [en] (WinNT; I)
X-Accept-Language: ru,en
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.api
Subject: Re: ethernet address
References: <3bfb835a_1@dnews> <3BFC22B7.10501@yahoo.com> <3bfc2c17_2@dnews> <3BFCBFE3.940A06A7@hotmail.zp.ua> <3bfcd859_1@dnews>
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 212.8.32.162
X-Trace: dnews 1006440918 212.8.32.162 (22 Nov 2001 06:55:18 -0800)
Lines: 35
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!dispose.news.demon.net!demon!diablo.theplanet.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews