BGPmon::Translator::XFB2PerlHash::Simpler - a cleaner interface to extract commonly-used information from XFB messages that, unline XFB2PerlHash::Simple, will ignore xml attributes.
use BGPmon::Translator::XFB2PerlHash::Simpler; my $xml_message = "... if(BGPmon::Translator::XFB2PerlHash::Simpler::parse_xml_msg($xml_message)){ print BGPmon::Translator::SFB2PerlHash::get_error_msg('parse_xml_msg')."\n"; exit 1; } my @withdrawn_prefixes = BGPmon::Translator::XFB2PerlHash::get_withdraw(); foreach(@withdrawn_prefixes){ ... } my $peer_address = BGPmon::Translator::XFB2PerlHash::extract_sender_addr(); print "Seen at peer $peer_address\n";
get_error_msg get_error_code parse_xml_msg extract_sender_addr extract_sender_port extract_sender_asn extract_withdraw extract_nlri extract_mpreach_nlri extract_mpunreach_nlri extract_aspath extract_as4path extract_origin
Will return the error message of the given function name.
Input: A string that contains the function name where an error occured.
Output: The message which represents the error stored from that function.
Will return the error code of the given function name.
Input: A string that represents the function name where an error occured.
Output: The code which represents the error stored from that function.
Will translate an XML message from a string to a perl hash
Input: An XML string from a BGPmon source
Output: 0 if parsing completed successfully
Will extract a sender's IP address from the parsed XML mesage.
Input: None
Output: IPv4/6 Address if successful; undef if not.
Will extract a sender's port number from the parsed XML mesage.
Output: Port number if successful; undef if not.
Will extract a sender's ASN number from the parsed XML mesage.
Output: ASN number if successful; undef if not.
Will extract all the withdrawn prefixes from the parsed XML mesage.
Output: Array of IPv4/6 prefixes that were seen to have been withdrawn.
Will extract all the prefixes in NLRI areas from the parsed XML mesage.
Output: Array of IPv4 prefixes that were seen in NLRIs.
Will extract all the IPv4/6 prefixes announced in MP_REACH_NLRI's from the parsed XML mesage. This will exclude the MP_REACH NEXT_HOP.
Output: Array of IPv4/6 prefixes that were seen in MP_REACH_NLRI's
Will extract all the IPv4/6 prefixes withdrawn in MP_UNREACH_NLRI's from the parsed XML mesage.
Output: Array of IPv4/6 prefixes that were seen in MP_UNREACH_NLRI's
Will extract all the ASNs found in either AS_PATH/AS_SET or AS_PATH/AS_SEQUENCE from the parsed XML mesage.
Output: Array of ASNs found in the AS_PATH path attribute.
Will extract all the ASNs found in either AS4_PATH/AS_SET or AS4_PATH/AS_SEQUENCE from the parsed XML mesage.
Output: Array of ASNs found in the AS4_PATH path attribute.
Will extract the ASN where the message was announced from within the parsed XML mesage.
Output: The ASN of the origin AS; undef if there is none.
The following error codes and messages are defined:
0: There isn't an error. 'No Error. Relax with some tea.'
200: Run parse_xml_message first. "There was no XML message given."
201: Invalid xml message given "The XML message given was blank."
M. Lawrence Weikum <mweikum at rams.colostate.edu>
<mweikum at rams.colostate.edu>
Please report any bugs or feature requeues to bgpmon at netsec.colostate.edu or through the web interface at http://bgpmon.netsec.colostate.edu.
bgpmon at netsec.colostate.edu
You can find documentation on this module with the perldoc command.
perldoc BGPmon::Filter
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: Simpler.pm Authors: M. Lawrence Weikum Date: 13 October 2013
To install BGPmon::Log, copy and paste the appropriate command in to your terminal.
cpanm
cpanm BGPmon::Log
CPAN shell
perl -MCPAN -e shell install BGPmon::Log
For more information on module installation, please visit the detailed CPAN module installation guide.