NAME
BGPmon::Translator::XFB2BGPdump - Converts an XML message into an array of BGPdump formatted messages.
SYNOPSIS
This module takes a XML message as input and outputs a string in libbgpdump format.
use BGPmon::Translator::XFB2BGPdump;
my %bgpdump_strs = translate_msg ($xml_message);
foreach my $safi (sort{$a <= $b} keys %bgpdump_strs) {
print "Printing bgpdump lines for prefixes with safi value $safi\n";
my @safi_lines = @{$bgpdump_strs{$safi}};
foreach my $bgpdump_line (@safi_lines) {
print "$bgpdump_line\n";
}
}
EXPORT
translate_message translate_msg get_error_code get_error_message get_error_msg
SUBROUTINES/METHODS
translate_message
This function accepts exactly one XML message and returns a hash of arrays, indexed by SAFI values. Each array contains bgpdump formatted strings for the SAFI value.
Inputs: 1. xmlmessage : Exactly one XML message.
Outputs: 1. Returns a hash of arrays, indexed by SAFI values. Each array contains bgpdump formatted strings for the SAFI value.
translate_msg
Shorthand call for translate_message.
get_error_code
Get the error code for a given function Input : the name of the function whose error code we should report Output: the function's error code or ARGUMENT_ERROR if the user did not supply a function or INVALID_FUNCTION_SPECIFIED if the user provided an invalid function Usage: my $err_code = get_error_code("connect_archive");
get_error_message {
Get the error message of a given function
Input : the name of the function whose error message we should report
Output: the function's error message
or ARGUMENT_ERROR if the user did not supply a function
or INVALID_FUNCTION_SPECIFIED if the user provided an invalid function
Usage: my $err_msg = get_error_message("read_xml_message");
get_error_msg
Shorthand call for get_error_message
BUGS
Please report any bugs or feature requests to
C<bgpmon at netsec.colostate.edu>, or through the web interface at
L<http://bgpmon.netsec.colostate.edu>.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc BGPmon::Client
LICENSE AND COPYRIGHT Copyright (c) 2012 Colorado State University
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom
the Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
File: XFB2BGPdump.pm
Authors: M. Lawrence Weikum, Kaustubh Gadkari, Dan Massey, Cathie Olschanowsky
Date: 13 October 2013