Skip to content

Commit

Permalink
Add missing ETH_P_ALL identifier to socket (#11876)
Browse files Browse the repository at this point in the history
  • Loading branch information
bytemarx authored May 10, 2024
1 parent 37f9e4c commit a10e413
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions stdlib/socket.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,13 @@ if sys.version_info >= (3, 12):
ETHERTYPE_VLAN as ETHERTYPE_VLAN,
)

if sys.platform == "linux":
from _socket import ETH_P_ALL as ETH_P_ALL

if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darwin":
# FreeBSD >= 14.0
from _socket import PF_DIVERT as PF_DIVERT

# Re-exported from errno
EBADF: int
EAGAIN: int
Expand Down Expand Up @@ -525,6 +532,9 @@ class AddressFamily(IntEnum):
AF_BLUETOOTH = 32
if sys.platform == "win32" and sys.version_info >= (3, 12):
AF_HYPERV = 34
if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darwin" and sys.version_info >= (3, 12):
# FreeBSD >= 14.0
AF_DIVERT = 44

AF_INET = AddressFamily.AF_INET
AF_INET6 = AddressFamily.AF_INET6
Expand Down Expand Up @@ -577,6 +587,9 @@ if sys.platform != "win32" or sys.version_info >= (3, 9):

if sys.platform == "win32" and sys.version_info >= (3, 12):
AF_HYPERV = AddressFamily.AF_HYPERV
if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darwin" and sys.version_info >= (3, 12):
# FreeBSD >= 14.0
AF_DIVERT = AddressFamily.AF_DIVERT

class SocketKind(IntEnum):
SOCK_STREAM = 1
Expand Down

0 comments on commit a10e413

Please sign in to comment.