We want to be able to identify the Locale of a computer based on it's IP address. The locale means the nearest City and Country.
1) The program should be written in Java.
2) It should not query a third party database or
3) It should support both Windows and Mac
The easiest way that we can think of is to implement Trace Route. Trace route is a program that sends out ICMP packets with increasing Time to live (TTL) values. The packets echo across the Internet and traces out the hops the packet takes. The echo packet from the ISP (which is usually the first or second hop) has a city code like: tor01 or bos2 .. tor being toronto, bos being boston (for example).
The program needs to grab this value, parse it and compare it against a list to identify the nearest city.
The main difficulties in writing this code are that there is no native implementation in Java. The programmer will have to use JNI (Java Native Interface)
See this web site, for hints and you can contact the authors for help if required.
<[url removed, login to view]>
The program should implement a function:
public Locale getIPLocation (int operatingSystem)
Locale is an object which contains City and Country information. We will pass the operating system as 1 = Windows and 2=MAC
Your program must then figure out the IP, implement trace route. Find the first hop that has city information. Parse the city codes, compare them to a list of city codes and determine the locale to the nearest city of that computer.
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
Windows 2000, XP, 2003, Vista