gh-89415: Add source-specific multicast constants to socket module (#103684)

Add socket options for source-specific multicast when present as C #defines.

Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
This commit is contained in:
Reese Hyde 2023-04-27 00:05:55 -04:00 committed by GitHub
parent 9169a56fad
commit 1d99e9e46e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,2 @@
Add :mod:`socket` constants for source-specific multicast.
Patch by Reese Hyde.

View File

@ -8418,6 +8418,18 @@ socket_exec(PyObject *m)
#ifdef IP_BIND_ADDRESS_NO_PORT #ifdef IP_BIND_ADDRESS_NO_PORT
ADD_INT_MACRO(m, IP_BIND_ADDRESS_NO_PORT); ADD_INT_MACRO(m, IP_BIND_ADDRESS_NO_PORT);
#endif #endif
#ifdef IP_UNBLOCK_SOURCE
ADD_INT_MACRO(m, IP_UNBLOCK_SOURCE);
#endif
#ifdef IP_BLOCK_SOURCE
ADD_INT_MACRO(m, IP_BLOCK_SOURCE);
#endif
#ifdef IP_ADD_SOURCE_MEMBERSHIP
ADD_INT_MACRO(m, IP_ADD_SOURCE_MEMBERSHIP);
#endif
#ifdef IP_DROP_SOURCE_MEMBERSHIP
ADD_INT_MACRO(m, IP_DROP_SOURCE_MEMBERSHIP);
#endif
/* IPv6 [gs]etsockopt options, defined in RFC2553 */ /* IPv6 [gs]etsockopt options, defined in RFC2553 */
#ifdef IPV6_JOIN_GROUP #ifdef IPV6_JOIN_GROUP