audit_errno.h revision 186647
1186647Srwatson/*- 2186647Srwatson * Copyright (c) 2008 Apple Inc. 3186647Srwatson * All rights reserved. 4186647Srwatson * 5186647Srwatson * Redistribution and use in source and binary forms, with or without 6186647Srwatson * modification, are permitted provided that the following conditions 7186647Srwatson * are met: 8186647Srwatson * 1. Redistributions of source code must retain the above copyright 9186647Srwatson * notice, this list of conditions and the following disclaimer. 10186647Srwatson * 2. Redistributions in binary form must reproduce the above copyright 11186647Srwatson * notice, this list of conditions and the following disclaimer in the 12186647Srwatson * documentation and/or other materials provided with the distribution. 13186647Srwatson * 3. Neither the name of Apple Inc. ("Apple") nor the names of 14186647Srwatson * its contributors may be used to endorse or promote products derived 15186647Srwatson * from this software without specific prior written permission. 16186647Srwatson * 17186647Srwatson * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND 18186647Srwatson * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19186647Srwatson * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20186647Srwatson * ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR 21186647Srwatson * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22186647Srwatson * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23186647Srwatson * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24186647Srwatson * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 25186647Srwatson * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26186647Srwatson * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27186647Srwatson * POSSIBILITY OF SUCH DAMAGE. 28186647Srwatson * 29186647Srwatson * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_errno.h#4 30186647Srwatson * $FreeBSD: head/sys/bsm/audit_errno.h 186647 2008-12-31 11:12:24Z rwatson $ 31186647Srwatson */ 32186647Srwatson 33186647Srwatson#ifndef _BSM_AUDIT_ERRNO_H_ 34186647Srwatson#define _BSM_AUDIT_ERRNO_H_ 35186647Srwatson 36186647Srwatson/* 37186647Srwatson * For the purposes of portable encoding, we convert between local error 38186647Srwatson * numbers and Solaris error numbers (as well as some extensions for error 39186647Srwatson * numbers that don't exist in Solaris). Although the first 35 or so 40186647Srwatson * constants are the same across all OS's, we don't handle that in any 41186647Srwatson * special way. 42186647Srwatson * 43186647Srwatson * When adding constants here, also add them to bsm_errno.c. 44186647Srwatson */ 45186647Srwatson#define BSM_ESUCCESS 0 46186647Srwatson#define BSM_EPERM 1 47186647Srwatson#define BSM_ENOENT 2 48186647Srwatson#define BSM_ESRCH 3 49186647Srwatson#define BSM_EINTR 4 50186647Srwatson#define BSM_EIO 5 51186647Srwatson#define BSM_ENXIO 6 52186647Srwatson#define BSM_E2BIG 7 53186647Srwatson#define BSM_ENOEXEC 8 54186647Srwatson#define BSM_EBADF 9 55186647Srwatson#define BSM_ECHILD 10 56186647Srwatson#define BSM_EAGAIN 11 57186647Srwatson#define BSM_ENOMEM 12 58186647Srwatson#define BSM_EACCES 13 59186647Srwatson#define BSM_EFAULT 14 60186647Srwatson#define BSM_ENOTBLK 15 61186647Srwatson#define BSM_EBUSY 16 62186647Srwatson#define BSM_EEXIST 17 63186647Srwatson#define BSM_EXDEV 18 64186647Srwatson#define BSM_ENODEV 19 65186647Srwatson#define BSM_ENOTDIR 20 66186647Srwatson#define BSM_EISDIR 21 67186647Srwatson#define BSM_EINVAL 22 68186647Srwatson#define BSM_ENFILE 23 69186647Srwatson#define BSM_EMFILE 24 70186647Srwatson#define BSM_ENOTTY 25 71186647Srwatson#define BSM_ETXTBSY 26 72186647Srwatson#define BSM_EFBIG 27 73186647Srwatson#define BSM_ENOSPC 28 74186647Srwatson#define BSM_ESPIPE 29 75186647Srwatson#define BSM_EROFS 30 76186647Srwatson#define BSM_EMLINK 31 77186647Srwatson#define BSM_EPIPE 32 78186647Srwatson#define BSM_EDOM 33 79186647Srwatson#define BSM_ERANGE 34 80186647Srwatson#define BSM_ENOMSG 35 81186647Srwatson#define BSM_EIDRM 36 82186647Srwatson#define BSM_ECHRNG 37 /* Solaris/Linux-specific. */ 83186647Srwatson#define BSM_EL2NSYNC 38 /* Solaris/Linux-specific. */ 84186647Srwatson#define BSM_EL3HLT 39 /* Solaris/Linux-specific. */ 85186647Srwatson#define BSM_EL3RST 40 /* Solaris/Linux-specific. */ 86186647Srwatson#define BSM_ELNRNG 41 /* Solaris/Linux-specific. */ 87186647Srwatson#define BSM_EUNATCH 42 /* Solaris/Linux-specific. */ 88186647Srwatson#define BSM_ENOCSI 43 /* Solaris/Linux-specific. */ 89186647Srwatson#define BSM_EL2HLT 44 /* Solaris/Linux-specific. */ 90186647Srwatson#define BSM_EDEADLK 45 91186647Srwatson#define BSM_ENOLCK 46 92186647Srwatson#define BSM_ECANCELED 47 93186647Srwatson#define BSM_ENOTSUP 48 94186647Srwatson#define BSM_EDQUOT 49 95186647Srwatson#define BSM_EBADE 50 /* Solaris/Linux-specific. */ 96186647Srwatson#define BSM_EBADR 51 /* Solaris/Linux-specific. */ 97186647Srwatson#define BSM_EXFULL 52 /* Solaris/Linux-specific. */ 98186647Srwatson#define BSM_ENOANO 53 /* Solaris/Linux-specific. */ 99186647Srwatson#define BSM_EBADRQC 54 /* Solaris/Linux-specific. */ 100186647Srwatson#define BSM_EBADSLT 55 /* Solaris/Linux-specific. */ 101186647Srwatson#define BSM_EDEADLOCK 56 /* Solaris-specific. */ 102186647Srwatson#define BSM_EBFONT 57 /* Solaris/Linux-specific. */ 103186647Srwatson#define BSM_EOWNERDEAD 58 /* Solaris/Linux-specific. */ 104186647Srwatson#define BSM_ENOTRECOVERABLE 59 /* Solaris/Linux-specific. */ 105186647Srwatson#define BSM_ENOSTR 60 /* Solaris/Darwin/Linux-specific. */ 106186647Srwatson#define BSM_ENODATA 61 /* Solaris/Darwin/Linux-specific. */ 107186647Srwatson#define BSM_ETIME 62 /* Solaris/Darwin/Linux-specific. */ 108186647Srwatson#define BSM_ENOSR 63 /* Solaris/Darwin/Linux-specific. */ 109186647Srwatson#define BSM_ENONET 64 /* Solaris/Linux-specific. */ 110186647Srwatson#define BSM_ENOPKG 65 /* Solaris/Linux-specific. */ 111186647Srwatson#define BSM_EREMOTE 66 112186647Srwatson#define BSM_ENOLINK 67 113186647Srwatson#define BSM_EADV 68 /* Solaris/Linux-specific. */ 114186647Srwatson#define BSM_ESRMNT 69 /* Solaris/Linux-specific. */ 115186647Srwatson#define BSM_ECOMM 70 /* Solaris/Linux-specific. */ 116186647Srwatson#define BSM_EPROTO 71 117186647Srwatson#define BSM_ELOCKUNMAPPED 72 /* Solaris-specific. */ 118186647Srwatson#define BSM_ENOTACTIVE 73 /* Solaris-specific. */ 119186647Srwatson#define BSM_EMULTIHOP 74 120186647Srwatson#define BSM_EBADMSG 77 121186647Srwatson#define BSM_ENAMETOOLONG 78 122186647Srwatson#define BSM_EOVERFLOW 79 123186647Srwatson#define BSM_ENOTUNIQ 80 /* Solaris/Linux-specific. */ 124186647Srwatson#define BSM_EBADFD 81 /* Solaris/Linux-specific. */ 125186647Srwatson#define BSM_EREMCHG 82 /* Solaris/Linux-specific. */ 126186647Srwatson#define BSM_ELIBACC 83 /* Solaris/Linux-specific. */ 127186647Srwatson#define BSM_ELIBBAD 84 /* Solaris/Linux-specific. */ 128186647Srwatson#define BSM_ELIBSCN 85 /* Solaris/Linux-specific. */ 129186647Srwatson#define BSM_ELIBMAX 86 /* Solaris/Linux-specific. */ 130186647Srwatson#define BSM_ELIBEXEC 87 /* Solaris/Linux-specific. */ 131186647Srwatson#define BSM_EILSEQ 88 132186647Srwatson#define BSM_ENOSYS 89 133186647Srwatson#define BSM_ELOOP 90 134186647Srwatson#define BSM_ERESTART 91 135186647Srwatson#define BSM_ESTRPIPE 92 /* Solaris/Linux-specific. */ 136186647Srwatson#define BSM_ENOTEMPTY 93 137186647Srwatson#define BSM_EUSERS 94 138186647Srwatson#define BSM_ENOTSOCK 95 139186647Srwatson#define BSM_EDESTADDRREQ 96 140186647Srwatson#define BSM_EMSGSIZE 97 141186647Srwatson#define BSM_EPROTOTYPE 98 142186647Srwatson#define BSM_ENOPROTOOPT 99 143186647Srwatson#define BSM_EPROTONOSUPPORT 120 144186647Srwatson#define BSM_ESOCKTNOSUPPORT 121 145186647Srwatson#define BSM_EOPNOTSUPP 122 146186647Srwatson#define BSM_EPFNOSUPPORT 123 147186647Srwatson#define BSM_EAFNOSUPPORT 124 148186647Srwatson#define BSM_EADDRINUSE 125 149186647Srwatson#define BSM_EADDRNOTAVAIL 126 150186647Srwatson#define BSM_ENETDOWN 127 151186647Srwatson#define BSM_ENETUNREACH 128 152186647Srwatson#define BSM_ENETRESET 129 153186647Srwatson#define BSM_ECONNABORTED 130 154186647Srwatson#define BSM_ECONNRESET 131 155186647Srwatson#define BSM_ENOBUFS 132 156186647Srwatson#define BSM_EISCONN 133 157186647Srwatson#define BSM_ENOTCONN 134 158186647Srwatson#define BSM_ESHUTDOWN 143 159186647Srwatson#define BSM_ETOOMANYREFS 144 160186647Srwatson#define BSM_ETIMEDOUT 145 161186647Srwatson#define BSM_ECONNREFUSED 146 162186647Srwatson#define BSM_EHOSTDOWN 147 163186647Srwatson#define BSM_EHOSTUNREACH 148 164186647Srwatson#define BSM_EALREADY 149 165186647Srwatson#define BSM_EINPROGRESS 150 166186647Srwatson#define BSM_ESTALE 151 167186647Srwatson 168186647Srwatson/* 169186647Srwatson * OpenBSM constants for error numbers not defined in Solaris. In the event 170186647Srwatson * that these errors are added to Solaris, we will deprecate the OpenBSM 171186647Srwatson * numbers in the same way we do for audit event constants. 172186647Srwatson * 173186647Srwatson * ELAST doesn't get a constant in the BSM space. 174186647Srwatson */ 175186647Srwatson#define BSM_EPROCLIM 190 /* FreeBSD/Darwin-specific. */ 176186647Srwatson#define BSM_EBADRPC 191 /* FreeBSD/Darwin-specific. */ 177186647Srwatson#define BSM_ERPCMISMATCH 192 /* FreeBSD/Darwin-specific. */ 178186647Srwatson#define BSM_EPROGUNAVAIL 193 /* FreeBSD/Darwin-specific. */ 179186647Srwatson#define BSM_EPROGMISMATCH 194 /* FreeBSD/Darwin-specific. */ 180186647Srwatson#define BSM_EPROCUNAVAIL 195 /* FreeBSD/Darwin-specific. */ 181186647Srwatson#define BSM_EFTYPE 196 /* FreeBSD/Darwin-specific. */ 182186647Srwatson#define BSM_EAUTH 197 /* FreeBSD/Darwin-specific. */ 183186647Srwatson#define BSM_ENEEDAUTH 198 /* FreeBSD/Darwin-specific. */ 184186647Srwatson#define BSM_ENOATTR 199 /* FreeBSD/Darwin-specific. */ 185186647Srwatson#define BSM_EDOOFUS 200 /* FreeBSD-specific. */ 186186647Srwatson#define BSM_EJUSTRETURN 201 /* FreeBSD-specific. */ 187186647Srwatson#define BSM_ENOIOCTL 202 /* FreeBSD-specific. */ 188186647Srwatson#define BSM_EDIRIOCTL 203 /* FreeBSD-specific. */ 189186647Srwatson#define BSM_EPWROFF 204 /* Darwin-specific. */ 190186647Srwatson#define BSM_EDEVERR 205 /* Darwin-specific. */ 191186647Srwatson#define BSM_EBADEXEC 206 /* Darwin-specific. */ 192186647Srwatson#define BSM_EBADARCH 207 /* Darwin-specific. */ 193186647Srwatson#define BSM_ESHLIBVERS 208 /* Darwin-specific. */ 194186647Srwatson#define BSM_EBADMACHO 209 /* Darwin-specific. */ 195186647Srwatson#define BSM_EPOLICY 210 /* Darwin-specific. */ 196186647Srwatson#define BSM_EDOTDOT 211 /* Linux-specific. */ 197186647Srwatson#define BSM_EUCLEAN 212 /* Linux-specific. */ 198186647Srwatson#define BSM_ENOTNAM 213 /* Linux(Xenix?)-specific. */ 199186647Srwatson#define BSM_ENAVAIL 214 /* Linux(Xenix?)-specific. */ 200186647Srwatson#define BSM_EISNAM 215 /* Linux(Xenix?)-specific. */ 201186647Srwatson#define BSM_EREMOTEIO 216 /* Linux-specific. */ 202186647Srwatson#define BSM_ENOMEDIUM 217 /* Linux-specific. */ 203186647Srwatson#define BSM_EMEDIUMTYPE 218 /* Linux-specific. */ 204186647Srwatson#define BSM_ENOKEY 219 /* Linux-specific. */ 205186647Srwatson#define BSM_EKEYEXPIRED 220 /* Linux-specific. */ 206186647Srwatson#define BSM_EKEYREVOKED 221 /* Linux-specific. */ 207186647Srwatson#define BSM_EKEYREJECTED 222 /* Linux-specific. */ 208186647Srwatson 209186647Srwatson/* 210186647Srwatson * In the event that OpenBSM doesn't have a file representation of a local 211186647Srwatson * error number, use this. 212186647Srwatson */ 213186647Srwatson#define BSM_UNKNOWNERR 250 /* OpenBSM-specific. */ 214186647Srwatson 215186647Srwatson#endif /* !_BSM_AUDIT_ERRNO_H_ */ 216