Class MakeIPCounts

java.lang.Object
  |
  +--MakeIPCounts

public class MakeIPCounts
extends java.lang.Object

MakeIPCounts.java Jim Gast, jgast@cs.wisc.edu MakeIPCounts takes command-line arguments. See: usage() This program counts the number of IP addresses in each IPRange. The output can be redirected to a file (typically IPCounts.txt). IPCounts file format: Each line consists of a canonical IPRange (always includes bitLength), and the Autonomous System Number that owns that range 012.006.104.000/23 AS13625 The input file is expected to already be sorted by IPRange. Note that BGP routing tables sometimes put /24 addresses ahead of the /23 that contains them!


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 IPRange fullList
           
static long[] ipAddrsOwned
           
static int linesRead
           
static int rootChildren
           
 
Constructor Summary
MakeIPCounts()
           
 
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 printChildTree(java.lang.String prefix, IPRange rng)
           
static void printCountByASN()
           
static int printIPCounts(IPRange mother)
          compute the number of IP addresses in each Range, excluding holes
static void readIP2ASFile(java.io.InputStream sysIn)
           
static IPRange readIP2ASLine(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

linesRead

public static int linesRead

rootChildren

public static int rootChildren

ipAddrsOwned

public static long[] ipAddrsOwned

fullList

public static IPRange fullList

debugLevel

public 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


commas

public static java.text.DecimalFormat commas
Constructor Detail

MakeIPCounts

public MakeIPCounts()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
main method starts off with empty tables, builds a List of IPRanges and calculates the number of IP addresses that EXCLUSIVELY match that range. The IPCounts do not include ranges that are contained in other (more specific) routing entries.

Parameters:
args - options IP2ASTable
java.io.IOException

readIP2ASFile

public static void readIP2ASFile(java.io.InputStream sysIn)

readIP2ASLine

public static IPRange readIP2ASLine(java.lang.String str)
readRoutingLine finds all pairs of ASNumbers whether on best paths or worst. This routine parses the line and prints out one line for each adjacent pair of ASNumbers. By implication, there is a route that directly connects those Autonomous Systems in a single hop.


printIPCounts

public static int printIPCounts(IPRange mother)
compute the number of IP addresses in each Range, excluding holes


printChildTree

public static void printChildTree(java.lang.String prefix,
                                  IPRange rng)

printCountByASN

public static void printCountByASN()