+#define SO_LINGER_SEC 0x1080 /* linger on close if data present (in seconds) */
+#ifdef PRIVATE
+#define SO_RESTRICTIONS 0x1081 /* APPLE: deny flag set */
+#define SO_RESTRICT_DENY_IN 0x1 /* deny inbound (trapdoor) */
+#define SO_RESTRICT_DENY_OUT 0x2 /* deny outbound (trapdoor) */
+#define SO_RESTRICT_DENY_CELLULAR 0x4 /* deny use of cellular (trapdoor) */
+#endif /* PRIVATE */
+#define SO_RANDOMPORT 0x1082 /* APPLE: request local port randomization */
+#define SO_NP_EXTENSIONS 0x1083 /* To turn off some POSIX behavior */
+#endif
+
+#ifdef PRIVATE
+#define SO_EXECPATH 0x1085 /* Application Firewall Socket option */
+/*
+ * Traffic service class definitions (lowest to highest):
+ *
+ * SO_TC_BK_SYS
+ * "Background System-Initiated", high delay tolerant, high loss
+ * tolerant, elastic flow, variable size & long-lived. E.g: system-
+ * initiated iCloud synching or Time Capsule backup, for which there
+ * is no progress feedbacks.
+ *
+ * SO_TC_BK
+ * "Background", user-initiated, high delay tolerant, high loss tolerant,
+ * elastic flow, variable size. E.g. user-initiated iCloud synching or
+ * Time Capsule backup; or traffics of background applications, for which
+ * there is some progress feedbacks.
+ *
+ * SO_TC_BE
+ * "Best Effort", unclassified/standard. This is the default service
+ * class; pretty much a mix of everything.
+ *
+ * SO_TC_RD
+ * "Responsive Data", a notch higher than "Best Effort", medium delay
+ * tolerant, elastic & inelastic flow, bursty, long-lived. E.g. email,
+ * instant messaging, for which there is a sense of interactivity and
+ * urgency (user waiting for output).
+ *
+ * SO_TC_OAM
+ * "Operations, Administration, and Management", medium delay tolerant,
+ * low-medium loss tolerant, elastic & inelastic flows, variable size.
+ * E.g. VPN tunnels.
+ *
+ * SO_TC_AV
+ * "Multimedia Audio/Video Streaming", medium delay tolerant, low-medium
+ * loss tolerant, elastic flow, constant packet interval, variable rate &
+ * size. E.g. AirPlay playback (both video and audio).
+ *
+ * SO_TC_RV
+ * "Responsive Multimedia Audio/Video", low delay tolerant, low-medium
+ * loss tolerant, elastic flow, variable packet interval, rate and size.
+ * E.g. AirPlay mirroring, screen sharing.
+ *
+ * SO_TC_VI
+ * "Interactive Video", low delay tolerant, low-medium loss tolerant,
+ * elastic flow, constant packet interval, variable rate & size. E.g.
+ * FaceTime video.
+ *
+ * SO_TC_VO
+ * "Interactive Voice", low delay tolerant, low loss tolerant, inelastic
+ * flow, constant packet rate, somewhat fixed size. E.g. VoIP including
+ * FaceTime audio.
+ *
+ * SO_TC_CTL
+ * "Network Control", low delay tolerant, low loss tolerant, inelastic
+ * flow, rate is bursty but short, variable size. E.g. DNS queries;
+ * certain types of locally-originated ICMP, ICMPv6; IGMP/MLD join/leave,
+ * ARP.
+ */
+#define SO_TRAFFIC_CLASS 0x1086 /* Traffic service class (int) */
+#define SO_TC_BK_SYS 100 /* lowest class */
+#define SO_TC_BK 200
+#define SO_TC_BE 0
+#define SO_TC_RD 300
+#define SO_TC_OAM 400
+#define SO_TC_AV 500
+#define SO_TC_RV 600
+#define SO_TC_VI 700
+#define SO_TC_VO 800
+#define SO_TC_CTL 900 /* highest class */
+#define SO_TC_MAX 10 /* Total # of traffic classes */
+#ifdef XNU_KERNEL_PRIVATE
+#define _SO_TC_BK 1 /* deprecated */
+#define _SO_TC_VI 2 /* deprecated */
+#define _SO_TC_VO 3 /* deprecated */
+#define _SO_TC_MAX 4 /* deprecated */
+
+#define SO_VALID_TC(c) \
+ (c == SO_TC_BK_SYS || c == SO_TC_BK || c == SO_TC_BE || \
+ c == SO_TC_RD || c == SO_TC_OAM || c == SO_TC_AV || \
+ c == SO_TC_RV || c == SO_TC_VI || c == SO_TC_VO || c == SO_TC_CTL)
+#endif /* XNU_KERNEL_PRIVATE */
+
+/* Background socket configuration flags */
+#define TRAFFIC_MGT_SO_BACKGROUND 0x0001 /* background socket */
+#define TRAFFIC_MGT_TCP_RECVBG 0x0002 /* Only TCP sockets, receiver throttling */
+
+#define SO_RECV_TRAFFIC_CLASS 0x1087 /* Receive traffic class (bool)*/
+#define SO_TRAFFIC_CLASS_DBG 0x1088 /* Debug traffic class (struct so_tcdbg) */
+#define SO_TRAFFIC_CLASS_STATS 0x1089 /* Traffic class statistics */
+#define SO_PRIVILEGED_TRAFFIC_CLASS 0x1090 /* Privileged traffic class (bool) */
+#define SO_DEFUNCTOK 0x1100 /* can be defunct'd */
+#define SO_ISDEFUNCT 0x1101 /* get defunct status */
+
+#define SO_OPPORTUNISTIC 0x1102 /* deprecated; use SO_TRAFFIC_CLASS */
+
+/*
+ * SO_FLUSH flushes any unsent data generated by a given socket. It takes
+ * an integer parameter, which can be any of the SO_TC traffic class values,
+ * or the special SO_TC_ALL value.
+ */
+#define SO_FLUSH 0x1103 /* flush unsent data (int) */
+#define SO_TC_ALL (-1)
+
+#define SO_RECV_ANYIF 0x1104 /* unrestricted inbound processing */
+#define SO_TRAFFIC_MGT_BACKGROUND 0x1105 /* Background traffic management */
+
+#define SO_FLOW_DIVERT_TOKEN 0x1106 /* flow divert token */
+
+#define SO_DELEGATED 0x1107 /* set socket as delegate (pid_t) */
+#define SO_DELEGATED_UUID 0x1108 /* set socket as delegate (uuid_t) */
+
+#endif /* PRIVATE */
+#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
+