# Windows DSCP Fix Python Package
A Python package to fix `setsockopt(..,IP_TOS,..)` behavior on Windows.
### Why
- In the [IPPROTO_IP socket options](https://learn.microsoft.com/en-us/windows/win32/winsock/ipproto-ip-socket-options) for `setsockopt`, `IP_TOS` is marked as **"DO NOT USE"**, and [Windows QoS2 subsystem](https://learn.microsoft.com/en-us/previous-versions/windows/desktop/qos/introduction-to-qos2--qwave-) takes over the admission.
- ToS/DSCP value is still an important field for QoS guarantee in IEEE 802.11 network, according to [RFC 8325](https://www.rfc-editor.org/rfc/rfc8325). However, there is no existing convenient method to tune the value.
- On Windows, only DSCP value is allowed to set except ECN bits and the Administrator permission is required ([link](https://learn.microsoft.com/en-us/windows/win32/api/qos2/nf-qos2-qossetflow)). So, this functionality has to be maintained as a third-party module, which will not be accepted by mainline.
### Usage
```python
import socket
import windows_dscp_fix
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.IPPROTO_IP, socket.IP_TOS, 128) #NOTE: Administrator permission required
```
Raw data
{
"_id": null,
"home_page": null,
"name": "windows-dscp-fix",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "windows,network,socket,development,tos,dscp",
"author": null,
"author_email": "sudo_free <sudofree@163.com>",
"download_url": "https://files.pythonhosted.org/packages/9e/38/fbbb5ec99c0d9d834d31aa637268dae96c3620f9bb3658f2f3a20872265f/windows_dscp_fix-0.2.1.tar.gz",
"platform": null,
"description": "# Windows DSCP Fix Python Package\r\n\r\nA Python package to fix `setsockopt(..,IP_TOS,..)` behavior on Windows.\r\n\r\n### Why\r\n\r\n- In the [IPPROTO_IP socket options](https://learn.microsoft.com/en-us/windows/win32/winsock/ipproto-ip-socket-options) for `setsockopt`, `IP_TOS` is marked as **\"DO NOT USE\"**, and [Windows QoS2 subsystem](https://learn.microsoft.com/en-us/previous-versions/windows/desktop/qos/introduction-to-qos2--qwave-) takes over the admission.\r\n\r\n- ToS/DSCP value is still an important field for QoS guarantee in IEEE 802.11 network, according to [RFC 8325](https://www.rfc-editor.org/rfc/rfc8325). However, there is no existing convenient method to tune the value.\r\n\r\n- On Windows, only DSCP value is allowed to set except ECN bits and the Administrator permission is required ([link](https://learn.microsoft.com/en-us/windows/win32/api/qos2/nf-qos2-qossetflow)). So, this functionality has to be maintained as a third-party module, which will not be accepted by mainline.\r\n\r\n### Usage\r\n\r\n```python\r\nimport socket\r\nimport windows_dscp_fix\r\nsock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\r\nsock.setsockopt(socket.IPPROTO_IP, socket.IP_TOS, 128) #NOTE: Administrator permission required\r\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "fix setsockopt behavior for ToS/DSCP on Windows.",
"version": "0.2.1",
"split_keywords": [
"windows",
"network",
"socket",
"development",
"tos",
"dscp"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "5ec9b65a3c0a428ec805230ef3d39cc498ba32db8d4b5fc32e28b72475057cc5",
"md5": "ef6b5e0c454cc4b0b101bd7ae3a1889f",
"sha256": "a2a5f12e9f5d191f909b96536bec3337c9233721fd0d1ce054c9968c769a5b53"
},
"downloads": -1,
"filename": "windows_dscp_fix-0.2.1-cp311-none-win_amd64.whl",
"has_sig": false,
"md5_digest": "ef6b5e0c454cc4b0b101bd7ae3a1889f",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.7",
"size": 108538,
"upload_time": "2023-04-14T03:49:09",
"upload_time_iso_8601": "2023-04-14T03:49:09.171032Z",
"url": "https://files.pythonhosted.org/packages/5e/c9/b65a3c0a428ec805230ef3d39cc498ba32db8d4b5fc32e28b72475057cc5/windows_dscp_fix-0.2.1-cp311-none-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "9e38fbbb5ec99c0d9d834d31aa637268dae96c3620f9bb3658f2f3a20872265f",
"md5": "2177c9acea3259dfe6aa8dcb6c7db2ba",
"sha256": "d480fadca0a8c1a276538afce6f119e0c2f9d2dc00318903230720dd7cc791b4"
},
"downloads": -1,
"filename": "windows_dscp_fix-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "2177c9acea3259dfe6aa8dcb6c7db2ba",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 6502,
"upload_time": "2023-04-14T03:49:11",
"upload_time_iso_8601": "2023-04-14T03:49:11.719676Z",
"url": "https://files.pythonhosted.org/packages/9e/38/fbbb5ec99c0d9d834d31aa637268dae96c3620f9bb3658f2f3a20872265f/windows_dscp_fix-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-14 03:49:11",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "windows-dscp-fix"
}