Distinguishing between IPs Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
miclus
Can't get richer than this
Can't get richer than this
Posts: 741
Joined: Tue Mar 31, 2009 2:11 am

Distinguishing between IPs

Post by miclus » Thu Oct 22, 2009 6:54 am

Hi. I'm trying to make a way to distinguish between 2 people with the same IP. Since their names may change, I can't use that. For example, when I go to ping someone with IP 2.2.2.2, when it goes to update, it looks for the person with that IP. But, sometimes there are 2 people with that IP, so I need something else that distinguishes between them. Any ideas?

spectrum
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Sat Jul 21, 2007 12:17 pm

Post by spectrum » Thu Oct 22, 2009 8:10 am

hello miclus,

what does it mean 2 pepole with same ip ?
If you mean that 2 different people use the pc,
well there is no magic way to know who is using it, unless you develop a specific protocol that transmit the name.
If you mean instead that there are 2 PC with the same ip:
1)both togheter cannot be in the lan togheter or there is a network conflict.
2)if sometime one pc is "on", and sometime if go "off" and another pc goes up with the same address, get the "mac address" from the packet to know who is who.

hope it help,
regards
spectrum

TrV
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 630
Joined: Wed Jul 04, 2007 1:12 pm

Post by TrV » Thu Oct 22, 2009 8:34 am

spectrum wrote:get the "mac address" from the packet to know who is who.
That's also what i would have suggested.

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Thu Oct 22, 2009 8:53 am

If you have the control over the user creation, you can also use a GUID that you create per user, upon receiving a packet you see if the GUID you receive back (16 bytes number unique over the whole world) belongs to a specific user. The GUID is calculated based upon a MAC address, time stamp, and some other random data. Under linux it is called UUID and I am pretty sure it is cross platform. I wrote a small wrapper class a whle back but for the life of me I can't find it.

With regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Thu Oct 22, 2009 9:02 am

Found it!

http://wxcrp.cvs.sourceforge.net/viewvc ... iew=markup

Old, but when you dust it off, it should stiull be useful.

With regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

Post Reply