Re: how to detect MAC address

J

Joona I Palaste

If you want a unique serial number, you can get the CPU serial number.
The assembler source for it is posted at
http://mindprod.com/products.html#CPUSER
I could wrap it in JNI for you if you want.

What about platforms that DON'T have CPU serial numbers? AFAIK Java
supports those. Heck, Sun makes a reference implementation for Sun
SPARC, and AFAIK that particular processor family does not understand
Pentium III serial number requests. (Gee, wonder why?)
There might even be platforms that don't have *CPUs* in the first place.
Currently there are no such platforms but it isn't entirely
inconceivable that some might exist in the future. And I thought Java
was supposed to be cross-platform?

--
/-- Joona Palaste ([email protected]) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"It sure is cool having money and chicks."
- Beavis and Butt-head
 
S

Sudsy

Roedy said:
If you want a unique serial number, you can get the CPU serial number.
The assembler source for it is posted at
http://mindprod.com/products.html#CPUSER

Roedy,
I wouldn't want or even try to obtain a MAC address from Java.
It's just a pet peeve of mine that people think that they should
be able to do absolutely everything in one language.
Don't get me wrong: I love Java! So many classes and extensions,
so simple to do so many things. But it's not the right tool for
every job. Even Sun used to warn about not using Java for mission-
critical applications.
BTW, not every processor has a serial number.
 
A

Amey Samant

Sudsy said:
I wouldn't want or even try to obtain a MAC address from Java.
It's just a pet peeve of mine that people think that they should
be able to do absolutely everything in one language.
Don't get me wrong: I love Java! So many classes and extensions,
so simple to do so many things. But it's not the right tool for
every job. Even Sun used to warn about not using Java for mission-
critical applications.

hi there
i know that but i wonder if they give you the choice about platform
even in your organisation.....
i know such things can best be handled by lower rather (mid) level
language such as c ....
but if im doing a project & client wants to detect MAC address & he
wants it to be an applet

rgards
Amey
 
J

Joona I Palaste

hi there
i know that but i wonder if they give you the choice about platform
even in your organisation.....
i know such things can best be handled by lower rather (mid) level
language such as c ....
but if im doing a project & client wants to detect MAC address & he
wants it to be an applet

Then I guess your client is asking too much. The only way for Java to
get a MAC address is to use JNI, and I don't know if applets (unsigned
ones, at least) are allowed to use JNI at all. Tell your client that
there is more to Java than applets. Our company, for instance, is not
implementing our server-side database monitoring system as an applet.

--
/-- Joona Palaste ([email protected]) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"That's no raisin - it's an ALIEN!"
- Tourist in MTV's Oddities
 
R

Roedy Green

There might even be platforms that don't have *CPUs* in the first place.
Currently there are no such platforms but it isn't entirely
inconceivable that some might exist in the future. And I thought Java
was supposed to be cross-platform?

Perhaps eventually all machines will have a unique ID, either from
hardware, or by a process similar to generating a 128-bit private key.
 
R

Roedy Green

Perhaps eventually all machines will have a unique ID, either from
hardware, or by a process similar to generating a 128-bit private key.

I was surprised to discover my new Athlon CPU does not suport the
CPUID level 3 instruction to get a unique serial number. It does not
have one.
 
T

Tim Jowers

Joona I Palaste said:
Then I guess your client is asking too much. The only way for Java to
get a MAC address is to use JNI, and I don't know if applets (unsigned

... sounds to me like a weakness or future requirement of Java. Any
regular user mode app can talk to a driver so a Java app should be
able to also. Specifically in this case we are talking about raw
ethernet packets instead or IP packets. Is is true I can make IP
packets in Java without making TCP or UDP?

Requirement: JVM needs to abstract interface to drivers/devices.
Now we are talking true platform independence. Isn't this already
being done? Doesn't someone know?

Tim

P.S> My current project finds me writing code in Java, javascript,
VB6, C, and Cobol. Talk about using the right (or wrong!) language for
the right task.
 
J

Joona I Palaste

.. sounds to me like a weakness or future requirement of Java. Any
regular user mode app can talk to a driver so a Java app should be
able to also. Specifically in this case we are talking about raw
ethernet packets instead or IP packets. Is is true I can make IP
packets in Java without making TCP or UDP?

Are you aware that applets and apps are different things? A Java
app (i.e. application) can use JNI to talk to whatever it bloody wants
to. A Java applet, on the other hand, operates within a security
sandbox.

--
/-- Joona Palaste ([email protected]) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"'It can be easily shown that' means 'I saw a proof of this once (which I didn't
understand) which I can no longer remember'."
- A maths teacher
 
S

Sudsy

Roedy said:
I was surprised to discover my new Athlon CPU does not suport the
CPUID level 3 instruction to get a unique serial number. It does not
have one.

Roedy,
Why does this surprise you? Have you not been in the business long
enough to remember the brouhaha which came about when Intel first
started surreptitiously adding serial numbers to their CPUs? And then
people discovered that even more chips had gone out with serial
numbers than Intel at first admitted?
It's all about privacy, which is why I only use AMD chips these
days. This is not news, it's "olds". That's why I and others have
been saying that you can't rely on a CPU serial number or a MAC
address in order to implement a licensing scheme.
That's also why I don't think Sun did anything wrong by failing
to provide a mechanism for retrieving interface hardware addresses.
Next thing people would be asking for would be a method which would
allow them to change it! ;-)
As always, YMMV.
 
S

Sudsy

Roedy said:
I was lobbying FOR such numbers long before Intel implemented them.
Then the fuss seemed to die down. I thought it was all over but the
shouting. Intel's scheme allowed you to defang it if you wanted.

They SAID that you could run a small program to disable it but a
number of nerds demonstrated that it was still possible to retrieve
the serial number. Check out this page:

www.bigbrotherinside.org

I have joined the boycott. You and I obviously have different
opinions as to the value of such a mechanism. I'm wearing my user
hat and worry about invasions of privacy. You've apparently donned
a developer hat and are attempting to protect your intellectual
property. Different strokes and all...
 
T

Tim Jowers

Joona I Palaste said:
Are you aware that applets and apps are different things? A Java
app (i.e. application) can use JNI to talk to whatever it bloody wants
to. A Java applet, on the other hand, operates within a security
sandbox.
Yes. A sandboxed applet should not be able to do this. I shouldn't
have to write C because Java hasn't provided something it could. Can
you imagine me saying to a C# programmer they are going to have to
write C? But maybe this is the same in C#.
 
S

Steve Horsley

.. sounds to me like a weakness or future requirement of Java. Any
regular user mode app can talk to a driver so a Java app should be
able to also. Specifically in this case we are talking about raw
ethernet packets instead or IP packets. Is is true I can make IP
packets in Java without making TCP or UDP?
No.

Requirement: JVM needs to abstract interface to drivers/devices.
Now we are talking true platform independence. Isn't this already
being done? Doesn't someone know?

The JVM does abstract it - to the point of giving you Socket and
DatagramSocket and InetAddress. All so nicely abstracted that it works
even on systems that do not HAVE a MAC address, like my PC (my modem
doesn't have a MAC address). BTW, what 's the MAC address of your mobile
phone?

You seem to be wanting to remove or bypass the abstraction, something that
requires a lower level and more platform dependent language.

Steve
 
A

Amey Samant

i totally agree with Tim .....
they should provide something for it in j2se itself (excluding JNI)
if they can provide the Name of the network card interface ... they
should exploit it to go detailed descr than just name .....
as far roedy says that token ring may not have MAC address .... then
they can also provide APIs to check wat kinda standard 802.* is set up
& always handle the exception cases. there is a definite scope for
growth in this for j2se as today netowrks are growing increasingly
even at home user level.
its quite impressive to see the development(growth) in security area
from 1.3.* to todays version 1.4.*

wat u say ?

regards
amey
 
R

Roedy Green

You've apparently donned
a developer hat and are attempting to protect your intellectual
property.

When I came up with the idea of a CPU serial number many years ago I
was trying to invent a pain free copy protection scheme that did not
interfere with backups, and that allowed you to change your
configuration without disturbing it. I was not thinking about
privacy.

I still don't think I understand the privacy issue. I can see
protecting your identity when you browse the web, but it seems to me a
vendor has to know who you are if you want a paid update or software
rental service.


My goal is that I could be able to use any software I want at any
time, and just pay a lump fee depending on what I actually used. I
don't think I should have to pay any substantial amount just for
having a program on tap or one that I use only once a year or one I no
longer use.

see http://mindprod.com/projsoftwarerental.html
 
S

Sudsy

Roedy said:
You would have to reregister when the cpu changed, but that is fairly
rare. Current schemes reregister if ANYTHING changes at all about
your config. Reregistering is no longer such a big deal with the
internet. It can happen without user intervention if desired.

WRONG! And that's why people had such a big problem with the
registration of Windows 2000. Imagine the following scenario:
You've been dispatched to Tokyo and your CD-ROM drive decides
to travel farther south than you. No problem, right? Go down
to the Shinjuku district to find a cheap replacement. Only
problem now is that your system won't boot.
What are you going to do when Windows won't boot since you've
changed some hardware? Long-distance telephone call to Redmond
from Tokyo? Any idea what that costs? Sitting on hold for 30-
45 minutes?
Perhaps you know about some magical mechanism whereby you can
annonymously connect and have reregistration performed auto-
magically but all my sources indicate otherwise.
Elucidate, if you would be so kind.
 
R

Roedy Green

Perhaps you know about some magical mechanism whereby you can
annonymously connect and have reregistration performed auto-
magically but all my sources indicate otherwise.
Elucidate, if you would be so kind.

A grace period would handle much of that.

A long distance call could give you a key to get it going again.

My scheme allows you to run any software any time; it just records
usage for billing. See http://mindprod.com/projsoftwarerental.html

You can stay disconnected, but then you don't get any updates. As
soon as you reconnect for any update, Your billing info is captured.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top