BGPmon-core-1
view release on metacpan or search on metacpan
bin/output.txt view on Meta::CPAN
<xml><BGP_MESSAGE length="00001605" version="0.4" xmlns="urn:ietf:params:xml:ns:xfb-0.4" type_value="2" type="UPDATE"><BGPMON_SEQ id="2128112124" seq_num="1911668922"/><TIME timestamp="1372708015" datetime="2013-07-01T19:46:55Z" precision_time="254"/...
lib/BGPmon/Fetch/Archive.pm view on Meta::CPAN
'connection_duration');
use constant NO_ERROR_CODE => 0;
use constant NO_ERROR_MSG => 'No Error';
use constant UNDEFINED_ARGUMENT_CODE => 401;
use constant UNDEFINED_ARGUMENT_MSG => 'Undefined Argument(s)';
use constant UNCONNECTED_CODE => 402;
use constant UNCONNECTED_MSG => 'Not connected to an archive';
use constant ALREADY_CONNECTED_CODE => 403;
use constant ALREADY_CONNECTED_MSG => 'Already connected to an archive';
use constant NO_INDEX_PAGE_CODE => 404;
use constant NO_INDEX_PAGE_MSG => 'Unable to find an index page';
use constant SYSCALL_FAIL_CODE => 405;
use constant SYSCALL_FAIL_MSG => 'System call failed';
use constant INVALID_ARGUMENT_CODE => 406;
use constant INVALID_ARGUMENT_MSG => 'Invalid value given for argument';
use constant INIT_FAIL_CODE => 407;
use constant INIT_FAIL_MSG => 'Failed to initialize connection to archive';
use constant FILE_OPERATION_FAIL_CODE => 408;
use constant FILE_OPERATION_FAIL_MSG => 'File operation failed';
use constant DOWNLOAD_FAIL_CODE => 409;
lib/BGPmon/Fetch/Archive.pm view on Meta::CPAN
401: A subroutine was missing an expected argument
'Undefined Argument(s)'
402: There is no active connection to an archive
'Not connected to an archive'
403: There is a currently-active connection to an archive
'Already connected to an archive'
404: The module was unable to find an HTML index page
or any download links on the index page
'Unable to find an index page'
405: A system call failed
'System call failed'
406: An invalid value was passed to a subroutine as an argument
'Invalid value given for argument'
407: The connection could not be initialized, either by a failure
t/00-bgpmon-filter.t view on Meta::CPAN
require_ok('Regexp::IPv6');
require_ok('Net::Address::IP::Local');
my $resp = `pwd`;
my $location = 't/';
if($resp =~ m/bgpmon-tools\/BGPmon-core\/t/){
$location = '';
}
my $xml6msg = '<BGP_MESSAGE length="00002487" version="0.4" xmlns="urn:ietf:params:xml:ns:xfb-0.4" type_value="2" type="UPDATE"><BGPMON_SEQ id="2128112124" seq_num="2022934477"/><TIME timestamp="1343706329" datetime="2012-07-31T03:45:29Z" precision_t...
#Testing Init
my $retVal = BGPmon::Filter::init();
ok($retVal == 0, 'Init Test');
#Testing Reset
t/00-bgpmon-filter.t view on Meta::CPAN
is($res, TRUE, "XML IPv4 WITHDRAWN tag");
#--testing for correct <WITHDRAW> filtering
$xml6msg = '<BGP_MESSAGE length="00001263" version="0.4" xmlns="urn:ietf:params:xml:ns:xfb-0.4" type_value="2" type="UPDATE"><BGPMON_SEQ id="2128112124" seq_num="2022933907"/><TIME timestamp="1343706306" datetime="2012-07-31T03:45:06Z" precision_time...
my $res1 = BGPmon::Filter::matches($xml6msg);
is($res1, TRUE, "XML IPv6 Withdraw tag");
#--testing for addresses in <NLRI>
$xml4msg = '<BGP_MESSAGE length="00002181" version="0.4" xmlns="urn:ietf:params:xml:ns:xfb-0.4" type_value="2" type="UPDATE"><BGPMON_SEQ id="2128112124" seq_num="2021378732"/><TIME timestamp="1343692801" datetime="2012-07-31T00:00:01Z" precision_time...
my $res2 = BGPmon::Filter::matches($xml4msg);
is($res2, TRUE, "XML IPv4 NLRI tag");
#--testing for addresses in <MP_REACH_NLRI> for IPv6
$xml6msg = '<BGP_MESSAGE length="00002062" version="0.4" xmlns="urn:ietf:params:xml:ns:xfb-0.4" type_value="2" type="UPDATE"><BGPMON_SEQ id="127893688" seq_num="1540154687"/><TIME timestamp="1346261193" datetime="2012-08-29T17:26:33Z" precision_time=...
my $res3 = BGPmon::Filter::matches($xml6msg);
is($res3, TRUE, "XML IPv6 MP_REACH_NLRI tag");
#--testing for addresses in <MP_REACH_NLRI> for IPv4
$xml4msg = '<BGP_MESSAGE length="00002062" version="0.4" xmlns="urn:ietf:params:xml:ns:xfb-0.4" type_value="2" type="UPDATE"><BGPMON_SEQ id="127893688" seq_num="1540154687"/><TIME timestamp="1346261193" datetime="2012-08-29T17:26:33Z" precision_time=...
my $res8 = BGPmon::Filter::matches($xml4msg);
is($res8, TRUE, "XML IPv4 MP_REACH_NLRI tag");
#--testing for addresses in <MP_UNREACH_NLRI> for IPv6
$xml6msg = '<BGP_MESSAGE length="00001265" version="0.4" xmlns="urn:ietf:params:xml:ns:xfb-0.4" type_value="2" type="UPDATE"><BGPMON_SEQ id="2128112124" seq_num="2022934043"/><TIME timestamp="1343706309" datetime="2012-07-31T03:45:09Z" precision_time...
my $res4 = BGPmon::Filter::matches($xml6msg);
is($res4, TRUE, "XML IPv6 MP_UNREACH_NLRI tag");
#--testing for addresses in <MP_UNREACH_NLRI> for IPv4
$xml4msg = '<BGP_MESSAGE length="00001265" version="0.4" xmlns="urn:ietf:params:xml:ns:xfb-0.4" type_value="2" type="UPDATE"><BGPMON_SEQ id="2128112124" seq_num="2022934043"/><TIME timestamp="1343706309" datetime="2012-07-31T03:45:09Z" precision_time...
my $res9 = BGPmon::Filter::matches($xml4msg);
is($res9, TRUE, "XML IPv4 MP_UNREACH_NLRI tag");
#--testing for as number in as path - last as number
$xml4msg = '<BGP_MESSAGE length="00002457" version="0.4" xmlns="urn:ietf:params:xml:ns:xfb-0.4" type_value="2" type="UPDATE"><BGPMON_SEQ id="2128112124" seq_num="2021378733"/><TIME timestamp="1343692801" datetime="2012-07-31T00:00:01Z" precision_time...
my $res5 = BGPmon::Filter::matches($xml4msg);
is($res5, TRUE, "XML AS Last in AS_PATH");
#--testing more specific prefix matching works correctly
BGPmon::Filter::filterReset();
BGPmon::Filter::parse_config_file($location.'bgpmon-filter-config-ms.txt');
BGPmon::Filter::condense_prefs();
BGPmon::Filter::optimize_prefs();
$xml4msg = '<BGP_MESSAGE length="00001140" version="0.4" xmlns="urn:ietf:params:xml:ns:xfb-0.4" type_value="2" type="UPDATE"><BGPMON_SEQ id="127893688" seq_num="1541418969"/><TIME timestamp="1346459370" datetime="2012-09-01T00:29:30Z" precision_time=...
t/08-bgpmon-fetchdata-file.t view on Meta::CPAN
use warnings;
use strict;
use Test::More;
use BGPmon::Fetch::File qw/init_bgpdata connect_file read_xml_message
get_error_code get_error_message close_connection messages_read is_connected/;
use BGPmon::Log;
my $first_msg = "<ARCHIVER><TIME timestamp=\"1340136304\" datetime=\"2012-06-19T20:05:04Z\"/><EVENT cause=\"CREATE_NEW_FILE\">OPENED</EVENT></ARCHIVER>";
my $second_msg = "<BGP_MESSAGE xmlns=\"urn:ietf:params:xml:ns:xfb-0.4\" length=\"00001735\" version=\"0.4\" type_value=\"2\" type=\"UPDATE\"><BGPMON_SEQ id=\"2128112124\" seq_num=\"-1913318876\"/><TIME timestamp=\"1340136301\" datetime=\"2012-06-19T2...
#set the data directory
#my $data_dir = `echo -n \`pwd\``."/t/data";
#my $data_dir = 't';
my $resp = `pwd`;
my $location = 't/';
if($resp =~ m/bgpmon-tools\/BGPmon-core\/t/){
$location = '';
}
t/bgpmon-translator-dup-archiver-msg.xml view on Meta::CPAN
<xml>
<ARCHIVER><TIME timestamp="1340137050" datetime="2012-06-19T20:17:30Z"/><EVENT cause="CREATE_NEW_FILE">OPENED</EVENT></ARCHIVER>
<BGP_MESSAGE length="00001014" version="0.4" xmlns="urn:ietf:params:xml:ns:xfb-0.4" type_value="2" type="UPDATE"><BGPMON_SEQ id="2128112124" seq_num="-1912865104"/><TIME timestamp="1340136901" datetime="2012-06-19T20:15:01Z" precision_time="872"/><PE...
<ARCHIVER><TIME timestamp="1340137050" datetime="2012-06-19T20:17:30Z"/><EVENT cause="CREATE_NEW_FILE">OPENED</EVENT></ARCHIVER>
<BGP_MESSAGE length="00002123" version="0.4" xmlns="urn:ietf:params:xml:ns:xfb-0.4" type_value="2" type="UPDATE"><BGPMON_SEQ id="2128112124" seq_num="-1912864606"/><TIME timestamp="1340136902" datetime="2012-06-19T20:15:02Z" precision_time="874"/><PE...
<BGP_MESSAGE length="00001526" version="0.4" xmlns="urn:ietf:params:xml:ns:xfb-0.4" type_value="2" type="UPDATE"><BGPMON_SEQ id="2128112124" seq_num="-1912864604"/><TIME timestamp="1340136903" datetime="2012-06-19T20:15:03Z" precision_time="125"/><PE...
<BGP_MESSAGE length="00002326" version="0.4" xmlns="urn:ietf:params:xml:ns:xfb-0.4" type_value="2" type="UPDATE"><BGPMON_SEQ id="2128112124" seq_num="937304719"/><TIME timestamp="1338591194" datetime="2012-06-01T22:53:14Z" precision_time="358"/><PEER...
<BGP_MESSAGE length="00003239" version="0.4" xmlns="urn:ietf:params:xml:ns:xfb-0.4" type_value="2" type="UPDATE"><BGPMON_SEQ id="2128112124" seq_num="937306212"/><TIME timestamp="1338591255" datetime="2012-06-01T22:54:15Z" precision_time="796"/><PEER...
<BGP_MESSAGE length="00002753" version="0.4" xmlns="urn:ietf:params:xml:ns:xfb-0.4" type_value="2" type="UPDATE"><BGPMON_SEQ id="2128112124" seq_num="1796914189"/><TIME timestamp="1341638512" datetime="2012-07-07T05:21:52Z" precision_time="713"/><PEE...
</xml>
( run in 0.964 second using v1.01-cache-2.11-cpan-39bf76dae61 )