|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cysols.iodef.utils.ASUtilities
public class ASUtilities
This is a utility class which has mainly two static methods; one is to return a country name from IP Address, another is to return AS number from IP Address. Perl scripts are used for resolving the country name and AS number. "ip2country.pl" is to resolve the country name. This script is called by ipToCountry(String ipAddr) method. On the other hand, two perl scripts are required when this class resolves the AS number. It cannot return the AS number without running the perl as_paths_dNew.pl daemon script. It is provided as another package. How to use is as follows;
0. extracts ASPATHS.tgz
1. run as follows
%./as_paths_dNew.pl tmp/*
reading database....
database has been read.
aut-num -- 10032 import -- 30346 route -- 260152 origin -- 260148 Lines = 3588540, Ignored = 2688963
^Z
Suspended
%bg
[1] ./as_paths_dNew.pl tmp/alltel.db tmp/altdb.db tmp/ans.db tmp/aoltw.db ... &
Then, "as_paths_cN.pl" is called from ipToASNumber(String ipAddr) and the AS number is resolved through those perl scripts.
| Field Summary | |
|---|---|
static String |
DEFAULT_IP2AS_PATH
Default program path of as_paths_cN.pl (AS number resolver). |
static String |
DEFAULT_IP2COUNTRY_PATH
Default program path of ip2country.pl (country name resovler). |
static String |
UNKNOWN
A string when an IP Address cannot be resolved to its AS Number or country name. |
| Method Summary | |
|---|---|
static String |
getIP2ASCommandPath()
Returns the path of command to convert IP address to AS number. |
static String |
getIP2CountryCommandPath()
Returns the path of command to convert IP address to country string. |
static String |
ipToASNumber(String ipAddr)
Convert the specified IP address to the corresponding AS number. |
static String |
ipToCountry(String ipAddr)
Convert the specified IP address to the corresponding counrty string. |
static void |
setIP2ASCommandPath(String path)
Sets the path of command to convert IP address to AS number as the specified. |
static void |
setIP2CountryCommandPath(String path)
Sets the path of command to convert IP address to country string as the specified. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_IP2AS_PATH
public static final String DEFAULT_IP2COUNTRY_PATH
public static final String UNKNOWN
| Method Detail |
|---|
public static String getIP2ASCommandPath()
public static void setIP2ASCommandPath(String path)
path - IP address to AS number command path.public static String getIP2CountryCommandPath()
public static void setIP2CountryCommandPath(String path)
path - IP address to country string command path.public static String ipToASNumber(String ipAddr)
ipAddr - IP address to be converted to AS number.
public static String ipToCountry(String ipAddr)
ipAddr - IP address to be converted to country string.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||