]> git.saurik.com Git - apple/xnu.git/blob - bsd/net/net_kev.h
xnu-3789.41.3.tar.gz
[apple/xnu.git] / bsd / net / net_kev.h
1 /*
2 * Copyright (c) 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 _NET_NETKEV_H_
30 #define _NET_NETKEV_H_
31
32 #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
33
34 /* Kernel event subclass identifiers for KEV_NETWORK_CLASS */
35 #define KEV_INET_SUBCLASS 1 /* inet subclass */
36 /* KEV_INET_SUBCLASS event codes */
37 #define KEV_INET_NEW_ADDR 1 /* Userland configured IP address */
38 #define KEV_INET_CHANGED_ADDR 2 /* Address changed event */
39 #define KEV_INET_ADDR_DELETED 3 /* IPv6 address was deleted */
40 #define KEV_INET_SIFDSTADDR 4 /* Dest. address was set */
41 #define KEV_INET_SIFBRDADDR 5 /* Broadcast address was set */
42 #define KEV_INET_SIFNETMASK 6 /* Netmask was set */
43 #define KEV_INET_ARPCOLLISION 7 /* ARP collision detected */
44 #ifdef __APPLE_API_PRIVATE
45 #define KEV_INET_PORTINUSE 8 /* use ken_in_portinuse */
46 #endif
47 #define KEV_INET_ARPRTRFAILURE 9 /* ARP resolution failed for router */
48 #define KEV_INET_ARPRTRALIVE 10 /* ARP resolution succeeded for router */
49
50 #define KEV_DL_SUBCLASS 2 /* Data Link subclass */
51 /*
52 * Define Data-Link event subclass, and associated
53 * events.
54 */
55 #define KEV_DL_SIFFLAGS 1
56 #define KEV_DL_SIFMETRICS 2
57 #define KEV_DL_SIFMTU 3
58 #define KEV_DL_SIFPHYS 4
59 #define KEV_DL_SIFMEDIA 5
60 #define KEV_DL_SIFGENERIC 6
61 #define KEV_DL_ADDMULTI 7
62 #define KEV_DL_DELMULTI 8
63 #define KEV_DL_IF_ATTACHED 9
64 #define KEV_DL_IF_DETACHING 10
65 #define KEV_DL_IF_DETACHED 11
66 #define KEV_DL_LINK_OFF 12
67 #define KEV_DL_LINK_ON 13
68 #define KEV_DL_PROTO_ATTACHED 14
69 #define KEV_DL_PROTO_DETACHED 15
70 #define KEV_DL_LINK_ADDRESS_CHANGED 16
71 #define KEV_DL_WAKEFLAGS_CHANGED 17
72 #define KEV_DL_IF_IDLE_ROUTE_REFCNT 18
73 #define KEV_DL_IFCAP_CHANGED 19
74 #define KEV_DL_LINK_QUALITY_METRIC_CHANGED 20
75 #define KEV_DL_NODE_PRESENCE 21
76 #define KEV_DL_NODE_ABSENCE 22
77 #define KEV_DL_MASTER_ELECTED 23
78 #define KEV_DL_ISSUES 24
79 #define KEV_DL_IFDELEGATE_CHANGED 25
80 #define KEV_DL_AWDL_RESTRICTED 26
81 #define KEV_DL_AWDL_UNRESTRICTED 27
82 #define KEV_DL_RRC_STATE_CHANGED 28
83 #define KEV_DL_QOS_MODE_CHANGED 29
84
85 #ifdef PRIVATE
86 #define KEV_NETPOLICY_SUBCLASS 3 /* Network policy subclass */
87 /* KEV_NETPOLICY_SUBCLASS event codes */
88 #define KEV_NETPOLICY_IFDENIED 1 /* denied access to interface */
89 #define KEV_NETPOLICY_IFFAILED 2 /* failed to bring up interface */
90
91 #define KEV_SOCKET_SUBCLASS 4 /* Socket subclass */
92 /* KEV_SOCKET_SUBCLASS event codes */
93 #define KEV_SOCKET_CLOSED 1 /* completely closed by protocol */
94 #endif /* PRIVATE */
95
96 #define KEV_INET6_SUBCLASS 6 /* inet6 subclass */
97 /* KEV_INET6_SUBCLASS event codes */
98 #define KEV_INET6_NEW_USER_ADDR 1 /* Userland configured IPv6 address */
99 #define KEV_INET6_CHANGED_ADDR 2 /* Address changed event (future) */
100 #define KEV_INET6_ADDR_DELETED 3 /* IPv6 address was deleted */
101 #define KEV_INET6_NEW_LL_ADDR 4 /* Autoconf LL address appeared */
102 #define KEV_INET6_NEW_RTADV_ADDR 5 /* Autoconf address has appeared */
103 #define KEV_INET6_DEFROUTER 6 /* Default router detected */
104
105 #ifdef PRIVATE
106 #define KEV_ND6_SUBCLASS 7 /* IPv6 NDP subclass */
107 /* KEV_ND6_SUBCLASS event codes */
108 #define KEV_ND6_RA 1
109 #define KEV_ND6_NDFAILURE 2 /* IPv6 neighbor cache entry expiry */
110 #define KEV_ND6_NDALIVE 3 /* IPv6 neighbor reachable */
111
112 #define KEV_NECP_SUBCLASS 8 /* NECP subclasss */
113 /* KEV_NECP_SUBCLASS event codes */
114 #define KEV_NECP_POLICIES_CHANGED 1
115
116 #define KEV_NETAGENT_SUBCLASS 9 /* Net-Agent subclass */
117 /* Network Agent kernel event codes */
118 #define KEV_NETAGENT_REGISTERED 1
119 #define KEV_NETAGENT_UNREGISTERED 2
120 #define KEV_NETAGENT_UPDATED 3
121 #define KEV_NETAGENT_UPDATED_INTERFACES 4
122
123 #define KEV_LOG_SUBCLASS 10 /* Log subclass */
124 /* KEV_LOG_SUBCLASS event codes */
125 #define IPFWLOGEVENT 0
126
127 #define KEV_NETEVENT_SUBCLASS 11 /* Generic Net events subclass */
128 /* KEV_NETEVENT_SUBCLASS event codes */
129 #define KEV_NETEVENT_APNFALLBACK 1
130 #endif /* PRIVATE */
131
132 #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
133
134 #endif /* _NET_NETKEV_H_ */