File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -474,6 +474,13 @@ if sys.version_info >= (3, 12):
474474 ETHERTYPE_VLAN as ETHERTYPE_VLAN ,
475475 )
476476
477+ if sys .platform == "linux" :
478+ from _socket import ETH_P_ALL as ETH_P_ALL
479+
480+ if sys .platform != "linux" and sys .platform != "win32" and sys .platform != "darwin" :
481+ # FreeBSD >= 14.0
482+ from _socket import PF_DIVERT as PF_DIVERT
483+
477484# Re-exported from errno
478485EBADF : int
479486EAGAIN : int
@@ -525,6 +532,9 @@ class AddressFamily(IntEnum):
525532 AF_BLUETOOTH = 32
526533 if sys .platform == "win32" and sys .version_info >= (3 , 12 ):
527534 AF_HYPERV = 34
535+ if sys .platform != "linux" and sys .platform != "win32" and sys .platform != "darwin" and sys .version_info >= (3 , 12 ):
536+ # FreeBSD >= 14.0
537+ AF_DIVERT = 44
528538
529539AF_INET = AddressFamily .AF_INET
530540AF_INET6 = AddressFamily .AF_INET6
@@ -577,6 +587,9 @@ if sys.platform != "win32" or sys.version_info >= (3, 9):
577587
578588if sys .platform == "win32" and sys .version_info >= (3 , 12 ):
579589 AF_HYPERV = AddressFamily .AF_HYPERV
590+ if sys .platform != "linux" and sys .platform != "win32" and sys .platform != "darwin" and sys .version_info >= (3 , 12 ):
591+ # FreeBSD >= 14.0
592+ AF_DIVERT = AddressFamily .AF_DIVERT
580593
581594class SocketKind (IntEnum ):
582595 SOCK_STREAM = 1
You can’t perform that action at this time.
0 commit comments