M. Lawrence Weikum > BGPmon-core-1-092 > BGPmon::Fetch::Client

Download:
BGPmon-core-1-092.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Module Version: 1.092   Source  

NAME ^

BGPmon::Fetch::Client

The BGPmon Client module, to connect to BGPmon and receive XML messages one at a time.

SYNOPSIS ^

The BGPmon::Client module provides functionality to connect to a bgpmon instance and read one XML message at a time.

    use BGPmon::Fetch::Client;
    my $ret = connect_bgpmon();
    set_timeout($time_out_seconds);
    my $xml_msg = read_xml_message();
    my $ret = is_connected();
    my $num_read = messages_read();
    my $uptime = uptime();
    my $ret = close_connection();
    my $downtime = connection_endtime();

EXPORT ^

init_bgpdata connect_bgpmon set_timeout read_xml_message close_connection is_connected messages_read uptime connection_endtime

SUBROUTINES/METHODS ^

init_bgpdata

Initializes the client module. Takes no arguments.

set_timeout

Sets the socket timeout value in seconds. Takes one argument - the timeout value in seconds.

connect_bgpmon

This function connects to the BGPmon server. If the connection succeeds, the function attempts to read the starting <xml> tag from the BGPmon server. If that succeeds, the created socket is returned. If not, the function returns undef.

read_xml_message

This function reads one xml message at a time from the BGPmon XML stream.

close_connection

Function to close open files and sockets.

is_connected

Function to report whether currently connected to BGPmon.

messages_read

Get number of messages read.

uptime

Returns number of seconds the connection has been up. If the connection is down, return 0.

connection_endtime

Returns the time the connection ended . If the connection is up, return 0.

read_n_bytes

This function reads exactly n bytes from a connection. returns undef on any error or connection close

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

AUTHOR ^

Kaustubh Gadkari, <kaustubh at cs.colostate.edu>

BUGS ^

Please report any bugs or feature requests to bgpmon at netsec.colostate.edu, or through the web interface at 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: Client.pm
  Authors: Kaustubh Gadkari, Dan Massey, Cathie Olschanowsky
  Date: May 21, 2012
syntax highlighting: