Documentation for the CAIDA::ASFinder module

Overview

CAIDA::ASFinder is used to map an IP address to an AS number, with the assistance of a BGP routing table. The C++ code it's based on requires a modern C++ compiler. (eg. gcc > 2.8)

new CAIDA::ASFinder
Constructor for creation of an ASFinder object.

Sample call: $as_finder = new CAIDA::ASFinder;
CAIDA::ASFinder::load_file_text(STR filename)
This function loads in a parsed route table output by parse_bgp_dump and stores the data internally. This function must be called before using get_as().

filename: The file to be loaded.

Returns false if there was an error, true otherwise.

Sample call: $as_finder->load_file_text($filename) or die("Error loading $filename!\n");
CAIDA::ASFinder::get_as(STR dotted_ip)
This function searches for an AS and network that corresponds to a specific IP address.

dotted_ip: The dotted IP address to find an AS for.

Returns a list of AS number, network, and netmask if successful, or a list of false values if no AS/network could be found.

Sample call: ($as, $net, $mask) = $as_finder->get_as("192.172.226.30");
CAIDA::ASFinder::get_as_raw(SCALAR binary_ip)
Like get_as, but uses the raw (non-string) IP address.

binary_ip: The IP address to find an AS for.

Returns a list of AS number, network, and netmask if successful, or a list of false values if no AS/network could be found.

(Contrived) sample call: use Socket;
$ip = inet_aton("192.172.226.30");
($as, $net, $mask) = $as_finder->get_as($ip);

Problems? Write us:
coral-bugs@caida.org