|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--MakeIP2AS
MakeIP2AS.java Jim Gast, jgast@cs.wisc.edu MakeIP2AS takes command-line arguments. See: usage() This program constructs a tree for doing longest prefix match on IP addresses The output can be redirected to a file (typically IP2AS.txt). IP2AS file format: Each line consists of a canonical IPRange (always includes bitLength), and the ASnumber the range belongs to. 012.006.104.000/23 13625 This output line tells you that 12.6.104.0/23 is in AS13625 The input file is NOT expected to already be sorted by IPRange because BGP routing tables sometimes put /24 addresses ahead of the /23 that contains them! The output file contains leading zeroes so an alphabetic sort will give the same ordering as a numeric sort. The output file should be sorted to ensure all children come after their parents have already been put into the tree.
Field Summary | |
static java.text.DecimalFormat |
commas
|
static int |
debugLevel
drives debugging output debugLevel = 5 traces actions in methods 4 logs method entry / exit 3 dumps structures 2 displays internal statistics 1 dumps final statistics |
static int |
linesRead
|
static int |
rangesWritten
|
Constructor Summary | |
MakeIP2AS()
|
Method Summary | |
static void |
main(java.lang.String[] args)
main method starts off with empty tables, builds a List of IPRanges and calculates the number of IP addresses that EXCLUSIVELY match that range. |
static void |
readRoutingFile(java.io.InputStream sysIn)
readRoutingFile reads lines of a BGP routing file until EOF. |
static IPRange |
readRoutingLine(java.lang.String str)
readRoutingLine finds all pairs of ASNumbers whether on best paths or worst. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int linesRead
public static int rangesWritten
public static java.text.DecimalFormat commas
public static int debugLevel
Constructor Detail |
public MakeIP2AS()
Method Detail |
public static void main(java.lang.String[] args) throws java.io.IOException
args
- options bgpRoutingTable
java.io.IOException
public static void readRoutingFile(java.io.InputStream sysIn)
public static IPRange readRoutingLine(java.lang.String str)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |