]> git.saurik.com Git - apple/xnu.git/blob - bsd/netinet/in_tclass.h
xnu-3789.70.16.tar.gz
[apple/xnu.git] / bsd / netinet / in_tclass.h
1 /*
2 * Copyright (c) 2015-2016 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29 #ifndef __NETINET_IN_TCLASS_H__
30 #define __NETINET_IN_TCLASS_H__
31
32 #ifdef PRIVATE
33
34 #include <sys/types.h>
35 #include <sys/socket.h>
36 #include <sys/socketvar.h>
37 #include <sys/mbuf.h>
38 #include <net/if.h>
39 #include <net/if_var.h>
40
41 #define SO_TCDBG_PID 0x01 /* Set/get traffic class policy for PID */
42 #define SO_TCDBG_PNAME 0x02 /* Set/get traffic class policy for processes of that name */
43 #define SO_TCDBG_PURGE 0x04 /* Purge entries for unused PIDs */
44 #define SO_TCDBG_FLUSH 0x08 /* Flush all entries */
45 #define SO_TCDBG_COUNT 0x10 /* Get count of entries */
46 #define SO_TCDBG_LIST 0x20 /* List entries */
47 #define SO_TCDBG_DELETE 0x40 /* Delete a process entry */
48 #define SO_TCDBG_TCFLUSH_PID 0x80 /* Flush traffic class for PID */
49
50 struct so_tcdbg {
51 u_int32_t so_tcdbg_cmd;
52 int32_t so_tcdbg_tclass;
53 int32_t so_tcdbg_netsvctype;
54 u_int32_t so_tcdbg_count;
55 pid_t so_tcdbg_pid;
56 u_int32_t so_tcbbg_qos_mode;
57 char so_tcdbg_pname[(2 * MAXCOMLEN) + 1];
58 };
59 #define QOS_MODE_MARKING_POLICY_DEFAULT 0
60 #define QOS_MODE_MARKING_POLICY_ENABLE 1
61 #define QOS_MODE_MARKING_POLICY_DISABLE 2
62
63 #define NET_QOS_MARKING_POLICY_DEFAULT QOS_MODE_MARKING_POLICY_DEFAULT /* obsolete, to be removed */
64 #define NET_QOS_MARKING_POLICY_ENABLE QOS_MODE_MARKING_POLICY_ENABLE /* obsolete, to be removed */
65 #define NET_QOS_MARKING_POLICY_DISABLE QOS_MODE_MARKING_POLICY_DISABLE /* obsolete, to be removed */
66
67 #ifdef BSD_KERNEL_PRIVATE
68
69 extern int net_qos_policy_restricted;
70 extern int net_qos_policy_wifi_enabled;
71 extern int net_qos_policy_capable_enabled;
72
73 extern void net_qos_map_init(void);
74 extern errno_t set_packet_qos(struct mbuf *, struct ifnet *, boolean_t, int,
75 int, u_int8_t *);
76 extern int so_get_netsvc_marking_level(struct socket *);
77
78 #endif /* BSD_KERNEL_PRIVATE */
79
80 #endif /* PRIVATE */
81
82 #endif /* __NETINET_IN_TCLASS_H__ */