{ "info": { "author": "Benjamin Le Forestier", "author_email": "benjamin@leforestier.org", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": ".. image:: https://travis-ci.org/leforestier/ipsecparse.svg\n :target: https://travis-ci.org/leforestier/ipsecparse\n\nParse and edit your ipsec configuration files (ipsec.conf)\n\nInstallation\n~~~~~~~~~~~~\n\nTo install ipsecparse, simply:\n\n.. code-block:: console\n\n pip install ipsecparse\n\nExamples\n~~~~~~~~\n\n.. code:: python\n\n # Load the configuration from a string.\n\n from ipsecparse import loads\n\n conf = loads(open('/etc/ipsec.conf').read())\n\n # The configuration is represented as a dictionnary\n # (actually a subclass of OrderedDict)\n\n # Each section of the configuration is an OrderedDict.\n\n # Let's modify some settings:\n\n conf['config', 'setup']['nat_traversal'] = 'yes'\n\n conf['conn', 'myconn']['left'] = '192.168.0.10'\n\n # Create a connection:\n\n conf['conn', 'mynewconn'] = {\n 'leftsubnet': '10.0.0.0/16',\n 'right': '192.168.0.1'\n }\n\n # You can also use an OrderedDict if order matters to you:\n\n from collections import OrderedDict\n\n conf['conn', 'mynewconn'] = OrderedDict(\n lefsubnet = '10.0.0.0/16',\n right = '192.168.0.1'\n )\n\n # Delete a connection:\n\n del conf['conn', 'mynewconn']\n\n # Same thing with certification authorities. Create a CA:\n\n conf['ca', 'myca'] = {\n 'cacert': 'MyCert.pem',\n 'crluri': 'http://crl.example.com/mycrl.crl',\n 'auto': 'add'\n }\n\n # Delete it:\n\n del conf['ca', 'myca']\n\n # Add an include:\n\n conf['include', '/etc/ipsec.d/ipsec.include'] = True\n\n # Delete it:\n\n del conf['include', '/etc/ipsec.d/ipsec.include']\n\n # Display the new configuration as a string:\n\n print(conf.dumps())\n\n # with four spaces indents instead of the default tabulations:\n\n print(conf.dumps(indent = ' '))\n\n # Replace the old configuration file:\n\n with open('/etc/ipsec.conf', 'w') as fd:\n fd.write(conf.dumps())\n\n # Search for connections inside the configuration.\n # Pass a callable to the `conn_filter` method.\n\n for name, section in conf.conn_filter(\n lambda conn: conn.get('leftsubnet') == '10.0.0.0/16'\n ):\n section['auto'] = 'start'\n\n # Or use the Key and Keys class\n # (just to make queries a bit shorter)\n\n from ipsecparse import Key, Keys\n\n for name, section in conf.conn_filter(\n Key('leftsubnet') == '10.0.0.0/16'\n ):\n section['auto'] = 'start'\n\n for name, section in conf.conn_filter(\n Keys('left', 'right').contains('192.168.0.1')\n ):\n del conf['conn', name]\n\n\nGitHub repo: https://github.com/leforestier/ipsecparse\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/leforestier/ipsecparse", "keywords": "ipsec", "license": "", "maintainer": "", "maintainer_email": "", "name": "ipsecparse", "package_url": "https://pypi.org/project/ipsecparse/", "platform": "", "project_url": "https://pypi.org/project/ipsecparse/", "project_urls": { "Homepage": "https://github.com/leforestier/ipsecparse" }, "release_url": "https://pypi.org/project/ipsecparse/0.3.0/", "requires_dist": null, "requires_python": "", "summary": "Parse and edit your ipsec configuration files", "version": "0.3.0" }, "last_serial": 5572966, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "419ae66c65111de70a5f3c973c5e464c", "sha256": "f75fac9594593ca4420dd7b6d56e8abe6d4f924f2f723185a3794a5037aca9f1" }, "downloads": -1, "filename": "ipsecparse-0.0.1.tar.gz", "has_sig": false, "md5_digest": "419ae66c65111de70a5f3c973c5e464c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4370, "upload_time": "2014-09-17T15:30:22", "url": "https://files.pythonhosted.org/packages/14/e5/5e9adb79524f31d355e150178706d3a411e1ef1745481ad9fef4a08cca1b/ipsecparse-0.0.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "70e26291b1c430c7ca102af23fec3da1", "sha256": "868ff0670f3ddbdf1117e6ae1780d83199d3c1d3efa6e29da97f72aaccf94b48" }, "downloads": -1, "filename": "ipsecparse-0.0.1.zip", "has_sig": false, "md5_digest": "70e26291b1c430c7ca102af23fec3da1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6997, "upload_time": "2014-09-17T15:30:25", "url": "https://files.pythonhosted.org/packages/62/8e/ded62f7f43042a4815270eb5015b14792d2564f538e27ceb69210e0187b2/ipsecparse-0.0.1.zip" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "61b3cbf01ff5a0f83a2d7e5d61e2b8f7", "sha256": "9f6f88e705ca667ed9d904c40e7cef6f5c28659ce51484b260ae4fbdd0dec48b" }, "downloads": -1, "filename": "ipsecparse-0.1.0.tar.gz", "has_sig": false, "md5_digest": "61b3cbf01ff5a0f83a2d7e5d61e2b8f7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4458, "upload_time": "2015-02-19T13:00:08", "url": "https://files.pythonhosted.org/packages/5e/a6/3c5be33c482167532720bf04c9af6497dd5bef25b7ff2d0ec5a1dfd29ebb/ipsecparse-0.1.0.tar.gz" }, { "comment_text": "", "digests": { "md5": "12dfbdc3579b8105dd82f347e1a3b0ec", "sha256": "f2ce20c81c6a25e2f84b020bcd1e50bdce7c1b93486e1783c1584ead5383e88a" }, "downloads": -1, "filename": "ipsecparse-0.1.0.zip", "has_sig": false, "md5_digest": "12dfbdc3579b8105dd82f347e1a3b0ec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7093, "upload_time": "2015-02-19T13:00:10", "url": "https://files.pythonhosted.org/packages/1b/12/f88ac62f6da2dc0fafd29b569a8068df241d3b3f33e1a350853bd30e4e4a/ipsecparse-0.1.0.zip" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "09a419872ac8847797853ac962a9337b", "sha256": "70952ac315746c43e769b290435d3ebee0f6666b7263ea14e14cb2165817d637" }, "downloads": -1, "filename": "ipsecparse-0.2.0.tar.gz", "has_sig": false, "md5_digest": "09a419872ac8847797853ac962a9337b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4605, "upload_time": "2018-04-23T16:19:02", "url": "https://files.pythonhosted.org/packages/08/58/3640b5ff475d877fcd8bb4df0ebb695c6074021aefc7f4dfde78c35efc6c/ipsecparse-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "b7ca8ce1748877812f7c0f9e2338d6a1", "sha256": "d1d0daa2cda7c311d03817da8472b0ca5dddb26f52dfbba33bb6f9f676562433" }, "downloads": -1, "filename": "ipsecparse-0.3.0.tar.gz", "has_sig": false, "md5_digest": "b7ca8ce1748877812f7c0f9e2338d6a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4579, "upload_time": "2019-07-23T15:14:38", "url": "https://files.pythonhosted.org/packages/05/7d/24709be12867e3d202f82927db9879ebe4a9a20ef1b1c940bf95615ee1cf/ipsecparse-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b7ca8ce1748877812f7c0f9e2338d6a1", "sha256": "d1d0daa2cda7c311d03817da8472b0ca5dddb26f52dfbba33bb6f9f676562433" }, "downloads": -1, "filename": "ipsecparse-0.3.0.tar.gz", "has_sig": false, "md5_digest": "b7ca8ce1748877812f7c0f9e2338d6a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4579, "upload_time": "2019-07-23T15:14:38", "url": "https://files.pythonhosted.org/packages/05/7d/24709be12867e3d202f82927db9879ebe4a9a20ef1b1c940bf95615ee1cf/ipsecparse-0.3.0.tar.gz" } ] }