| 1 | /* |
| 2 | * Copyright (c) 2016-2018 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_PRIMARY_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 | #define KEV_DL_LOW_POWER_MODE_CHANGED 30 |
| 85 | |
| 86 | #define KEV_DL_MASTER_ELECTED (_Pragma("gcc warn Use KEV_DL_PRIMARY_ELECTED instead") KEV_DL_PRIMARY_ELECTED) |
| 87 | |
| 88 | |
| 89 | #define KEV_INET6_SUBCLASS 6 /* inet6 subclass */ |
| 90 | /* KEV_INET6_SUBCLASS event codes */ |
| 91 | #define KEV_INET6_NEW_USER_ADDR 1 /* Userland configured IPv6 address */ |
| 92 | #define KEV_INET6_CHANGED_ADDR 2 /* Address changed event (future) */ |
| 93 | #define KEV_INET6_ADDR_DELETED 3 /* IPv6 address was deleted */ |
| 94 | #define KEV_INET6_NEW_LL_ADDR 4 /* Autoconf LL address appeared */ |
| 95 | #define KEV_INET6_NEW_RTADV_ADDR 5 /* Autoconf address has appeared */ |
| 96 | #define KEV_INET6_DEFROUTER 6 /* Default router detected */ |
| 97 | #define KEV_INET6_REQUEST_NAT64_PREFIX 7 /* Asking for the NAT64-prefix */ |
| 98 | |
| 99 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ |
| 100 | #endif /* _NET_NETKEV_H_ */ |