PyBird

BIRD interface handler for Python
Download

PyBird Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Publisher Name:
  • Erik Romijn
  • Publisher web site:
  • http://solidlinks.nl

PyBird Tags


PyBird Description

BIRD interface handler for Python PyBird is a Python interface to the BIRD Internet Routing Daemon's UNIX control socket, handling the socket connections and parsing the output.In it's current state, you can use it to query the status of specific or all BGP peers.Usage example >>> from pybird import PyBird >>> pybird = PyBird(socket_file='/var/run/bird.ctl') >>> peer_state = pybird.get_peer_status('KPN') >>> peer_state True >>> peer_state 4214 >>> peer_state datetime.datetime(2011, 6, 19, 19, 57, 0, 0)You can also call ``get_peer_status()`` without a peer name, to get an arraywith all the BGP peers.Full field listAll fields that are decoded, if present:- ``name``: Name as configured in BIRD- ``protocol``: Currently always "BGP"- ``last_change``: Last state change as a ``datetime.datetime`` object- ``state``: String of the peer status, e.g. "Established" or "Passive"- ``up``: Boolean, True if session is Established- ``routes_imported``: Number of imported routes- ``routes_exported``: Number of exported routes- ``router_id``: BGP router idAnd all combinations of:``__``which BIRD supports.Test suiteThere is a series of tests in ``tests.py``. This includes a ``MockBird``: amocked BIRD instance, with fixed but real responses, that listens on a realUNIX socket. This means the tests do not only test parsing, but also socketinteraction.SourceThe source is kept on BitBucket: http://bitbucket.org/erikr/pybird Requirements: · Python


PyBird Related Software