{ "info": { "author": "George Zhao", "author_email": "georgezhao_1980@163.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries" ], "description": "===================\nIntroduction\n===================\npyDiameter is a library which is used to decoding and encoding Diameter protocol message.\n\nDiameter protocol is an AAA protocol and defined in RFC6733 (RFC3588 is obsoleted by RFC6733).\n\nDecoding a diameter protocol message means, the library will help application decode protolcol bytes to the library object, which is more simple to handle.\n\nEncoding a diameter protocol message means, the library will help application encode the library object(usually a DiaMessage object in pyDiameter library) into a bytes variable.\n\npyDiameter is written by python purely.\n\npyDiameter is written on python 3.6.5, python 2 is not supported.\n\n===================\nAuthor\n===================\nGeorge Zhao who is working for Nokia in 2010-2012, 2014-2018.\n\nmaito: georgezhao_1980@163.com\n\n===================\nHow to get it\n===================\n\n::\n\n\tpip install pyDiameter\n\n===================\nGetting start\n===================\nTo get a start for decoding or encoding a diameter message with pyDiameter, you can read the example after pip installing.\n\nThe example folder is located in pyDiameter folder in your site-packages of your Python.\n\nPlease refer to example-dictTest.py to get start for the Diameter protocol AVP dictionary.\n\nDictionary\n===============\nThis dictionary contains more than 2000 AVP definitions, as well as including several popular vendors definitions (Base, 3GPP, Nokia, Ericsson, Cisco etc.)\n\nPlease note that, decoding is depending on the dictionary defined in pyDiameter.pyDiaAVPDict, if you have some special AVP definition which is not contained in this dictionary, example-dictTest.py could help you to know how to add new AVP definition in the dictionary, and how to update it.\n\nPlease make sure that there are all definitions you need defined in the dictionary before decoding the diameter message.\n\nAVP and Message\n===============\nPlease refer to example-avp.py to get start for the Diameter protolcol AVP handling.\n\nAnd refer to example-msg1.py to get start for the Diameter protocol message handling.\n\nIf you want an example just like a 'Hello, world', please refer to code below.\n\n::\n\n\tfrom pyDiameter.pyDiaMessage import DiaMessage\n\tfrom pyDiameter.pyDiaAVPTypes import DiaAVPStr\n\tfrom pyDiameter.pyDiaAVPPath import DiaAVPPath\n\n\tmsg = DiaMessage()\n\tmsg.setRequestFlag()\n\tavp = DiaAVPStr()\n\tavp.setAVPCode(263)\n\tavp.setAVPVSFlag()\n\tavp.setAVPVendor(10415)\n\tavp.setAVPValue(b'Hello, world.')\n\tdap = DiaAVPPath()\n\tdap.setPath('')\n\tmsg.addAVPByPath(dap, avp)\n\npyDiameter supports only basic types defined in RFC6733.\n\nPlease refer to following table for supported types list. (import them from pyDiameter.pyDiaAVPTypes)\n\n=============== ===============\npyDiameter \t\tRFC6733\n=============== ===============\nDiaAVPStr \t\tOctectString\nDiaAVPInt32 \tInteger32\nDiaAVPUInt32 \tUnsigned32\nDiaAVPInt64 \tInteger64\nDiaAVPUInt64 \tUnsigned64\nDiaAVPFloat32 \tFloat32\nDiaAVPFloat64 \tFloat64\nDiaAVPGroup \tGrouped\n===============\t===============\n\nAll DiaAVPxxx classes are derived from DiaAVP which is defined in pyDiameter.pyDiaAVPBase. And users could not initialize a DiaAVP object since it is an abstract class.\n\nAll Sub-classes of DiaAVP have method called getAVPType().\n\nIt return a Python string which describes the type of the object.\n\nThe returned value could be one of values of following. (import them from pyDiameter.pyDiaAVPConst)\n\n================== ===============\nConst \t\t\t\tValue\n================== ===============\nAVP_TYPE_UNKNOWN \tunknown\nAVP_TYPE_STR \t\tstr\nAVP_TYPE_INT32 \t\tint32\nAVP_TYPE_UINT32 \tuint32\nAVP_TYPE_INT64 \t\tint64\nAVP_TYPE_UINT64 \tuint64\nAVP_TYPE_FLOAT32 \tfloat32\nAVP_TYPE_FLOAT64 \tfloat64\nAVP_TYPE_GROUP\t\tgrp\n================== ===============\n\nAVP Path\n===============\nWhen you operate DiaMessage object in pyDiameter.pyDiaMessage, sometimes, you need visit, add or remove some AVPs from the message.\n\nYou can use DiaAVPPath object to locate the AVP in the message.\n\nDiaAVPPath could be imported from pyDiameter.pyDiaAVPPath.\n\nAnd DiaAVPPath object uses a diameter avp path language to describe the AVP path. (Defined by George Zhao, not a well-known language.)\n\nThe AVP path is described as:\n\n::\n\n'vendor/avpCode[sameCodeIndex]->vendor/avpCode[sameCodeIndex]->vendor/avpCode[sameCodeIndex]...'\n\ne.g. 10415/628[1]->10415/630[0] means I want to visit the AVP, the location is: the first AVP 630(vendor 10415) under the second AVP 628(vendor 10415).\n\nsameCodeIndex means if there are several same AVPs with same AVP code and vendor, which index is target to be visited.\n\n**Note that, sameCodeIndex is counted from zero.**\n\nTools\n===============\n\nIn pyDiameter.pyDiaAVPTools, we provide four functions to help you treat some special AVP types.\n\nThe address type, and the time type are both derived from OctectString basic type according to RFC6733.\n\n================== ================================================================================================================================\nFunctions\t\t\tExamples\n================== ================================================================================================================================\naddress_to_bytes\taddress_to_bytes(('ipv4','172.18.0.1')); address_to_bytes(('ipv6','2000:1234:ac12:abcd:abcd:abcd:abcd:abc1'))\nbytes_to_address\tbytes_to_address(diameter_address_avp_bytes_buff)\ntime_to_bytes\t\ttime_to_bytes(year=1980, month=7 , day=8, hour=20, minute=0, second=0)\nbytes_to_time\t\tbytes_to_time(bytes_buff)\n================== ================================================================================================================================\n\n**Note that, time is counted from Year 1968 Jan 20, 03:14:08 to Year 2104, Feb 26, 09:42:23, according to RFC6733 and an even obsoleted RFC4330.**\n\n**Only ipv4 and ipv6 are supported by tools, other protocols should be handled by user as an ordinary OctectString.**\n\n**When you set ipv6 value, the compress ipv6 value could be supported by tools, like 2000::1 or ::1.**\n\nAny other problem, please refer to 'Any problem' section below.\n\n===================\nAny problem\n===================\nPlease contact georgezhao_1980@163.com\n\nAuthor will check mail irregularly, support is not guaranteed.\n\nAuthor will answer question as immediately as author can.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://not-available.now", "keywords": "", "license": "BSD License", "maintainer": "George Zhao", "maintainer_email": "georgezhao_1980@163.com", "name": "pyDiameter", "package_url": "https://pypi.org/project/pyDiameter/", "platform": "all", "project_url": "https://pypi.org/project/pyDiameter/", "project_urls": { "Homepage": "http://not-available.now" }, "release_url": "https://pypi.org/project/pyDiameter/0.18.7.15/", "requires_dist": null, "requires_python": "", "summary": "pyDiameter is created by George Zhao, who is working for NOKIA, 2010-2012, 2014-2018. This lib is used for encoding and decoding Diameter protocol message(an AAA protocol replace the RADIUS).", "version": "0.18.7.15" }, "last_serial": 4701823, "releases": { "0.18.7.13": [ { "comment_text": "", "digests": { "md5": "98ee980cb348e5e74d8927f48811faf0", "sha256": "6f9977fa70b2cb46d6e740306e941f77a3c66df2b890ac8e426a3197df6ace08" }, "downloads": -1, "filename": "pyDiameter-0.18.7.13.tar.gz", "has_sig": false, "md5_digest": "98ee980cb348e5e74d8927f48811faf0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39655, "upload_time": "2018-07-10T01:28:06", "url": "https://files.pythonhosted.org/packages/28/ff/fabb8af881b6acb7eefc05116f60a2e1ef29be3a7aec1d824dc54a29d8da/pyDiameter-0.18.7.13.tar.gz" } ], "0.18.7.14": [ { "comment_text": "", "digests": { "md5": "1af73bb836ad259e314bf82f85e1f791", "sha256": "7159ad232884eff01f8d256eb8b3df9eac404ac838585ef0fcaf0da3449fc99a" }, "downloads": -1, "filename": "pyDiameter-0.18.7.14.tar.gz", "has_sig": false, "md5_digest": "1af73bb836ad259e314bf82f85e1f791", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39632, "upload_time": "2018-10-12T09:42:38", "url": "https://files.pythonhosted.org/packages/5b/4c/01c2094a643f1627f396fb8bb97ac2bf9b34d8683c1b24c8005e512fa54c/pyDiameter-0.18.7.14.tar.gz" } ], "0.18.7.15": [ { "comment_text": "", "digests": { "md5": "3eebef9cebfd5b8f1748e19ab0d65cb2", "sha256": "3e9f211bc6807a25c9aab32ec273b540479044203ef91301ca15e0ef93396691" }, "downloads": -1, "filename": "pyDiameter-0.18.7.15.tar.gz", "has_sig": false, "md5_digest": "3eebef9cebfd5b8f1748e19ab0d65cb2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39650, "upload_time": "2019-01-16T06:31:52", "url": "https://files.pythonhosted.org/packages/c1/e6/6091aa72ab52a1de3afa6a9e79ccdd8edab8e73c42e27ae1b4aa789099e2/pyDiameter-0.18.7.15.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3eebef9cebfd5b8f1748e19ab0d65cb2", "sha256": "3e9f211bc6807a25c9aab32ec273b540479044203ef91301ca15e0ef93396691" }, "downloads": -1, "filename": "pyDiameter-0.18.7.15.tar.gz", "has_sig": false, "md5_digest": "3eebef9cebfd5b8f1748e19ab0d65cb2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39650, "upload_time": "2019-01-16T06:31:52", "url": "https://files.pythonhosted.org/packages/c1/e6/6091aa72ab52a1de3afa6a9e79ccdd8edab8e73c42e27ae1b4aa789099e2/pyDiameter-0.18.7.15.tar.gz" } ] }