1/* 2 * Copyright (c) 2013 Apple Inc. All rights reserved. 3 * 4 * @APPLE_LICENSE_HEADER_START@ 5 * 6 * The contents of this file constitute Original Code as defined in and 7 * are subject to the Apple Public Source License Version 1.1 (the 8 * "License"). You may not use this file except in compliance with the 9 * License. Please obtain a copy of the License at 10 * http://www.apple.com/publicsource and read it before using this file. 11 * 12 * This Original Code and all software distributed under the License are 13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER 14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the 17 * License for the specific language governing rights and limitations 18 * under the License. 19 * 20 * @APPLE_LICENSE_HEADER_END@ 21 */ 22 23#ifndef _IONETWORKTYPESPRIVATE_H 24#define _IONETWORKTYPESPRIVATE_H 25 26#ifdef KERNEL 27 28/*! @defined kIONetworkNotificationBPFTapStateChange 29 @discussion Notification indicates the BPF tap on the network 30 interface was enabled or disabled. 31*/ 32#define kIONetworkNotificationBPFTapStateChange \ 33 iokit_family_msg(sub_iokit_networking, 0x800) 34 35/*! @defined kIONetworkNotificationLoggingLevelChange 36 @discussion Notification indicates the logging level for the network 37 interface was changed. Call IONetworkInterface::getLoggingLevel() to 38 get the current logging level. 39*/ 40#define kIONetworkNotificationLoggingLevelChange \ 41 iokit_family_msg(sub_iokit_networking, 0x801) 42 43/*! @defined kIONetworkNotificationLoggingParametersChange 44 @discussion Notification indicates the interface has received a request 45 to change the logging parameters. An IONetworkInterfaceLoggingParameters 46 passed to the notification handler describes the new parameters. 47*/ 48#define kIONetworkNotificationLoggingParametersChange \ 49 iokit_family_msg(sub_iokit_networking, 0x802) 50 51/*! @defined kIONetworkNotificationInterfaceAddressChange 52 @discussion Notification indicates an interface address change. 53 The data payload points to an IONetworkInterfaceAddressChangeParameters. 54*/ 55#define kIONetworkNotificationInterfaceAddressChange \ 56 iokit_family_msg(sub_iokit_networking, 0x803) 57 58struct IONetworkInterfaceLoggingParameters 59{ 60 int32_t level; 61 uint32_t flags; 62 int32_t category; 63 int32_t subCategory; 64 uint32_t reserved[4]; 65}; 66 67// See IONetworkInterface::setInterfaceSubType() 68// Must mirror the IFNET_SUBFAMILY_* enums. 69enum { 70 kIONetworkInterfaceSubTypeNone = 0, 71 kIONetworkInterfaceSubTypeUSB = 1, 72 kIONetworkInterfaceSubTypeBluetooth = 2, 73 kIONetworkInterfaceSubTypeWiFi = 3, 74 kIONetworkInterfaceSubTypeThunderbolt = 4, 75 kIONetworkInterfaceSubTypeReserved = 5 76}; 77 78struct IONetworkInterfaceAddressChangeParameters 79{ 80 sa_family_t addressFamily; 81 uint32_t reserved[3]; 82}; 83 84#endif /* KERNEL */ 85 86/*! @defined kIONetworkTxStatusFailure 87 @discussion General transmission error. 88*/ 89#define kIONetworkTxStatusFailure \ 90 iokit_family_msg(sub_iokit_networking, 0x200) 91 92/*! @defined kIONetworkTxStatusRemotePeerAsleep 93 @discussion Peer is asleep. 94*/ 95#define kIONetworkTxStatusRemotePeerAsleep \ 96 iokit_family_msg(sub_iokit_networking, 0x201) 97 98/*! @defined kIONetworkTxStatusRemotePeerUnavailable 99 @discussion Peer is missing. 100*/ 101#define kIONetworkTxStatusRemotePeerUnavailable \ 102 iokit_family_msg(sub_iokit_networking, 0x202) 103 104/*! @defined kIONetworkTxStatusNoRemotePeer 105 @discussion Never found a peer. 106*/ 107#define kIONetworkTxStatusNoRemotePeer \ 108 iokit_family_msg(sub_iokit_networking, 0x203) 109 110/*! @defined kIONetworkTxStatusMACChannelUnavailable 111 @discussion Channel is non-configurable or denied. 112*/ 113#define kIONetworkTxStatusMACChannelUnavailable \ 114 iokit_family_msg(sub_iokit_networking, 0x204) 115 116/*! @defined kIONetworkTxStatusCRCError 117 @discussion CRC error on packet. 118*/ 119#define kIONetworkTxStatusCRCError \ 120 iokit_family_msg(sub_iokit_networking, 0x205) 121 122/*! @defined kIONetworkTxStatusLifetimeExpired 123 @discussion Packet waited too long and has expired. 124*/ 125#define kIONetworkTxStatusLifetimeExpired \ 126 iokit_family_msg(sub_iokit_networking, 0x206) 127 128/*! @defined kIONetworkTxStatusQueueStall 129 @discussion Packet was refused because queue stall was detected. 130*/ 131#define kIONetworkTxStatusQueueStall \ 132 iokit_family_msg(sub_iokit_networking, 0x207) 133 134/*! @defined kIONetworkTxStatusBusIOError 135 @discussion Packet never reached chip. 136*/ 137#define kIONetworkTxStatusBusIOError \ 138 iokit_family_msg(sub_iokit_networking, 0x208) 139 140/*! @defined kIONetworkTxStatusChipBufferUnavailable 141 @discussion Packet didn’t get space on chip, credit or flush issue. 142*/ 143#define kIONetworkTxStatusChipBufferUnavailable \ 144 iokit_family_msg(sub_iokit_networking, 0x209) 145 146/*! @defined kIONetworkTxStatusChipModeError 147 @discussion Packet wasn’t sent due to mode or state issue. 148*/ 149#define kIONetworkTxStatusChipModeError \ 150 iokit_family_msg(sub_iokit_networking, 0x20a) 151 152/*! @defined kIONetworkTxStatusUnderflow 153 @discussion Insufficient information was sent. 154*/ 155#define kIONetworkTxStatusUnderflow \ 156 iokit_family_msg(sub_iokit_networking, 0x20b) 157 158/*! @defined kIONetworkTxStatusOverflow 159 @discussion Too much information was sent. 160*/ 161#define kIONetworkTxStatusOverflow \ 162 iokit_family_msg(sub_iokit_networking, 0x20c) 163 164/*! @defined kIONetworkTxStatusNoResources 165 @discussion Insufficient resources to transmit. 166*/ 167#define kIONetworkTxStatusNoResources \ 168 iokit_family_msg(sub_iokit_networking, 0x20d) 169 170#endif /* !_IONETWORKTYPESPRIVATE_H */ 171