Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a317778

Browse files
gsauthofpablogsal
andauthored
bpo-44077: Expose IP_RECVTOS in the socket module (GH-25992)
Co-authored-by: Pablo Galindo <[email protected]>
1 parent 7265b27 commit a317778

4 files changed

Lines changed: 12 additions & 0 deletions

File tree

Doc/library/socket.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ Constants
379379
On Windows, ``TCP_KEEPIDLE``, ``TCP_KEEPINTVL`` appear if run-time Windows
380380
supports.
381381

382+
.. versionchanged:: 3.10
383+
``IP_RECVTOS`` was added.
384+
382385
.. data:: AF_CAN
383386
PF_CAN
384387
SOL_CAN_*

Doc/whatsnew/3.10.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,9 @@ The exception :exc:`socket.timeout` is now an alias of :exc:`TimeoutError`.
12191219
Add option to create MPTCP sockets with ``IPPROTO_MPTCP``
12201220
(Contributed by Rui Cunha in :issue:`43571`.)
12211221
1222+
Add ``IP_RECVTOS`` option to receive the type of service (ToS) or DSCP/ECN fields
1223+
(Contributed by Georg Sauthoff in :issue:`44077`.)
1224+
12221225
ssl
12231226
---
12241227
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
It's now possible to receive the type of service (ToS), a.k.a. differentiated
2+
services (DS), a.k.a. differenciated services code point (DSCP) and excplicit
3+
congestion notification (ECN) IP header fields with ``socket.IP_RECVTOS``.

Modules/socketmodule.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8024,6 +8024,9 @@ PyInit__socket(void)
80248024
#ifdef IP_RECVRETOPTS
80258025
PyModule_AddIntMacro(m, IP_RECVRETOPTS);
80268026
#endif
8027+
#ifdef IP_RECVTOS
8028+
PyModule_AddIntMacro(m, IP_RECVTOS);
8029+
#endif
80278030
#ifdef IP_RECVDSTADDR
80288031
PyModule_AddIntMacro(m, IP_RECVDSTADDR);
80298032
#endif

0 commit comments

Comments
 (0)