.. versionadded:: 3.9
+.. data:: AF_DIVERT
+ PF_DIVERT
+
+ These two constants, documented in the FreeBSD divert(4) manual page, are
+ also defined in the socket module.
+
+ .. availability:: FreeBSD >= 14.0.
+
+ .. versionadded:: 3.12
+
+
.. data:: AF_PACKET
PF_PACKET
PACKET_*
/* RDS sockets use sockaddr_in: fall-through */
#endif /* AF_RDS */
+#ifdef AF_DIVERT
+ case AF_DIVERT:
+ /* FreeBSD divert(4) sockets use sockaddr_in: fall-through */
+#endif /* AF_DIVERT */
+
case AF_INET:
{
struct maybe_idna host = {NULL, NULL};
ADD_INT_MACRO(m, AF_SYSTEM);
#endif
+/* FreeBSD divert(4) */
+#ifdef PF_DIVERT
+ PyModule_AddIntMacro(m, PF_DIVERT);
+#endif
+#ifdef AF_DIVERT
+ PyModule_AddIntMacro(m, AF_DIVERT);
+#endif
+
#ifdef AF_PACKET
ADD_INT_MACRO(m, AF_PACKET);
#endif