{ "info": { "author": "Peng Xiao", "author_email": "xiaoquwl@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7" ], "description": "LIBBGP\n======\n\n|Python Version| |Version| |License| |Build Status| |Test Coverage|\n\nThis is a BGP/BMP Message unpack/pack lib written by Python which is inspired by exabgp especially its code structure design.\nWe can use this lib to unpack or pack BGP/BMP messages both offline and online(like a live BGP speaker).\n\n\nQuick Start\n------------\n\nInstall from source code:\n\n.. code-block:: bash\n\n $ git clone https://github.com/smartbgp/libbgp\n $ cd libbgp\n $ python setup.py install\n\n\nor pip:\n\n.. code-block:: bash\n\n $ pip install libbgp\n\n\nUsage\n-----\n\n.. code-block:: bash\n\n $ python\n Python 2.7.10 (default, Jul 30 2016, 18:31:42)\n [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin\n Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n >>>\n >>> from pprint import pprint\n >>> from libbgp.bgp.message import Message\n >>> update_msg_dict = {\n ... 'type': 2,\n ... 'msg': {\n ... 'attr': {\n ... 1: 2,\n ... 2: [(2, [701, 71])],\n ... 3: '219.158.1.204',\n ... 5: 100,\n ... 6: 0,\n ... 7: [71, '16.96.243.103'],\n ... 8: ['NO_EXPORT', '1234:5678'],\n ... 9: '219.158.1.204',\n ... 10: ['219.158.1.209', '0.0.0.30']\n ... },\n ... 'nlri': ['192.168.1.1/32', '172.16.1.1/32'],\n ... 'withdraw': []\n ... }\n ... }\n >>> update_msg = Message.pack(update_msg_dict)\n >>> update_msg.hex_value\n '\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00f\\x02\\x00\\x00\\x00E@\\x01\\x01\\x02@\\x02\\x06\\x02\\x02\\x02\\xbd\\x00G@\\x03\\x04\\xdb\\x9e\\x01\\xcc@\\x05\\x04\\x00\\x00\\x00d@\\x06\\x01\\x00\\xc0\\x07\\x06\\x00G\\x10`\\xf3g\\xc0\\x08\\x08\\xff\\xff\\xff\\x01\\x04\\xd2\\x16.\\x80\\t\\x04\\xdb\\x9e\\x01\\xcc\\x80\\n\\x08\\xdb\\x9e\\x01\\xd1\\x00\\x00\\x00\\x1e \\xc0\\xa8\\x01\\x01 \\xac\\x10\\x01\\x01'\n >>> pprint(Message.unpack(update_msg.hex_value).dict())\n {'msg': {'attr': {1: 2,\n 2: [(2, [701, 71])],\n 3: '219.158.1.204',\n 5: 100,\n 6: 0,\n 7: [71, '16.96.243.103'],\n 8: ['NO_EXPORT', '1234:5678'],\n 9: '219.158.1.204',\n 10: ['219.158.1.209', '0.0.0.30']},\n 'nlri': ['192.168.1.1/32', '172.16.1.1/32'],\n 'withdraw': []},\n 'type': 2}\n >>> Message.unpack(update_msg.hex_value).dict() == update_msg_dict\n True\n >>>\n\n\nFor more examples, Please reference ``libbgp/examples``\n\nSupport\n-------\n\nPlease join our Slack http://smartbgp.slack.com/ for questions, discussion, suggestions, etc. And welcome to create issues and pull request.\n\n\n\n.. |Python Version| image:: https://img.shields.io/pypi/pyversions/Django.svg\n :target: https://github.com/smartbgp/libbgp\n\n.. |License| image:: https://img.shields.io/hexpm/l/plug.svg\n :target: https://github.com/smartbgp/libbgp/blob/master/LICENSE\n.. |Version| image:: https://img.shields.io/pypi/v/libbgp.svg?\n :target: http://badge.fury.io/py/libbgp\n.. |Build Status| image:: https://travis-ci.org/smartbgp/libbgp.svg?branch=master\n :target: https://travis-ci.org/smartbgp/libbgp\n\n.. |Test Coverage| image:: https://coveralls.io/repos/smartbgp/libbgp/badge.svg?branch=master\n :target: https://coveralls.io/r/smartbgp/libbgp", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/smartbgp/libbgp", "keywords": "BGP BMP Python", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "libbgp", "package_url": "https://pypi.org/project/libbgp/", "platform": "any", "project_url": "https://pypi.org/project/libbgp/", "project_urls": { "Homepage": "https://github.com/smartbgp/libbgp" }, "release_url": "https://pypi.org/project/libbgp/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "Python BGP/BMP Message parser lib", "version": "0.2.0" }, "last_serial": 2998764, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "7309eee3517dcdd59819ecc1096e2afa", "sha256": "b873dbc83190d8e5a2acb59b461bd75b8a92afbe168ff1597a7f967cb84431fe" }, "downloads": -1, "filename": "libbgp-0.2.0.tar.gz", "has_sig": false, "md5_digest": "7309eee3517dcdd59819ecc1096e2afa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22895, "upload_time": "2017-07-04T09:46:40", "url": "https://files.pythonhosted.org/packages/0c/4c/2995449bfb23e689cf35decaf672a97e3262ce5b785fea006977558aef36/libbgp-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7309eee3517dcdd59819ecc1096e2afa", "sha256": "b873dbc83190d8e5a2acb59b461bd75b8a92afbe168ff1597a7f967cb84431fe" }, "downloads": -1, "filename": "libbgp-0.2.0.tar.gz", "has_sig": false, "md5_digest": "7309eee3517dcdd59819ecc1096e2afa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22895, "upload_time": "2017-07-04T09:46:40", "url": "https://files.pythonhosted.org/packages/0c/4c/2995449bfb23e689cf35decaf672a97e3262ce5b785fea006977558aef36/libbgp-0.2.0.tar.gz" } ] }