1/* $Copyright: 2 * 3 * Copyright 1998-2000 by the Massachusetts Institute of Technology. 4 * 5 * All rights reserved. 6 * 7 * Permission to use, copy, modify, and distribute this software and its 8 * documentation for any purpose and without fee is hereby granted, 9 * provided that the above copyright notice appear in all copies and that 10 * both that copyright notice and this permission notice appear in 11 * supporting documentation, and that the name of M.I.T. not be used in 12 * advertising or publicity pertaining to distribution of the software 13 * without specific, written prior permission. Furthermore if you modify 14 * this software you must label your software as modified software and not 15 * distribute it in such a fashion that it might be confused with the 16 * original MIT software. M.I.T. makes no representations about the 17 * suitability of this software for any purpose. It is provided "as is" 18 * without express or implied warranty. 19 * 20 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 21 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 22 * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 23 * 24 * Individual source code files are copyright MIT, Cygnus Support, 25 * OpenVision, Oracle, Sun Soft, FundsXpress, and others. 26 * 27 * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira, 28 * and Zephyr are trademarks of the Massachusetts Institute of Technology 29 * (MIT). No commercial use of these trademarks may be made without prior 30 * written permission of MIT. 31 * 32 * "Commercial use" means use of a name in a product or other for-profit 33 * manner. It does NOT prevent a commercial firm from referring to the MIT 34 * trademarks in order to convey information (although in doing so, 35 * recognition of their trademark status should be given). 36 * $ 37 */ 38 39/* $Header: /Volumes/backup/dsmigrate/Dumps/../CVS/passwordserver_sasl/cyrus_sasl/mac/CommonKClient/mac_kclient3/Headers/KerberosSupport/SocketErrors.h,v 1.4 2005/01/10 19:10:48 snsimon Exp $ */ 40 41/* 42 * 43 * SocketErrors.h -- Error codes for socket errors. 44 * 45 */ 46 47/* NOTE: Before you add a new error code, check the other libraries to make sure that you 48 have not taken an error code range designated for another library. */ 49 50 51#ifndef _SOCKET_ERRORS_ 52#define _SOCKET_ERRORS_ 53 54 55/* New error definitions */ 56#define kSocketsFirstErr 200 /* The beginning of the sockets errors */ 57#define kENOTDIRErr 201 /* Not a directory */ 58#define kEISDIRErr 202 /* Is a directory */ 59#define kEPFNOSUPPORTErr 203 /* Protocol family not supported */ 60#define kEAFNOSUPPORTErr 204 /* Address family not supported */ 61#define kSockNotInitErr 205 /* Sockets lib is not initialized */ 62#define kSockAlreadyInitErr 206 /* Sockets lib is already initialized */ 63#define kNoOTErr 207 /* Open Transport is unavailable */ 64#define kSocketIsIdleErr 208 /* No operation in progress on socket */ 65#define kEMFILEErr 209 /* Too many sockets open */ 66#define kENOSPCErr 210 /* Not enough space to write output */ 67#define kEBADDOMAINNAMEErr 211 /* Bad domain name in TCP/IP settings */ 68#define kEBADNAMESERVERSErr 212 /* Bad name servers in TCP/IP settings */ 69#define kENONETWORKErr 213 /* No network: check TCP/IP settings */ 70#define kSocketsLastErr 299 /* The last sockets error */ 71 72#ifndef rez /* This part cannot be included by a rez file */ 73 74#include <OpenTptInternet.h> 75#include <errno.h> 76 77#undef ERANGE /* defined by errno.h -- but we want the OT definition */ 78 79/* Mappings from errno.h errors to OT LibC errors */ 80enum OTCompatErrors 81{ 82/* EPERM = kEPERMErr, /* Permission denied */ 83/* ENOENT = kENOENTErr, /* No such file or directory */ 84 ESRCH = kESRCHErr, /* No such process */ 85 ENORSRC = kENORSRCErr, /* No such resource */ 86 EINTR = kEINTRErr, /* Interrupted system service */ 87/* EIO = kEIOErr, /* I/O error */ 88 ENXIO = kENXIOErr, /* No such device or address */ 89/* EBADF = kEBADFErr, /* Bad file number */ 90 EAGAIN = kEAGAINErr, /* Try operation again later */ 91/* ENOMEM = kENOMEMErr, /* Not enough space */ 92/* EACCES = kEACCESErr, /* Permission denied */ 93 EFAULT = kEFAULTErr, /* Bad address */ 94 EBUSY = kEBUSYErr, /* Device or resource busy */ 95/* EEXIST = kEEXISTErr, /* File exists */ 96 ENODEV = kENODEVErr, /* No such device */ 97 ENOTDIR = kENOTDIRErr, /* Not a directory */ 98/* EISDIR = kEISDIRErr, /* Is a directory */ 99/* EMFILE = kEMFILEErr, /* Too many sockets open */ 100/* EINVAL = kEINVALErr, /* Invalid argument */ 101 ENOTTY = kENOTTYErr, /* Not a character device */ 102 EPIPE = kEPIPEErr, /* Broken pipe */ 103/* ENOSPC = kENOSPCErr, /* Not enough space to write output */ 104 105 ERANGE = kERANGEErr, /* Message size too large for STREAM */ 106 EDEADLK = kEDEADLKErr, /* or a deadlock would occur */ 107 108 EPROTO = kEPROTOErr, /* Protocol error */ 109 EBADMSG = kEBADMSGErr, /* Trying to read unreadable message */ 110 ECANCEL = kECANCELErr, /* Operation cancelled */ 111 ENOMSG = kENOMSGErr, /* No message of desired type */ 112 113 ENOSTR = kENOSTRErr, /* Device not a stream */ 114 ENODATA = kENODATAErr, /* No data (for no delay I/O) */ 115 ETIME = kETIMEErr, /* Timer expired */ 116 ENOSR = kENOSRErr, /* Out of streams resources */ 117 118 ENOTSOCK = kENOTSOCKErr, /* Socket operation on non-socket */ 119 EDESTADDRREQ = kEDESTADDRREQErr, /* Destination address required */ 120 EMSGSIZE = kEMSGSIZEErr, /* Message too long */ 121 EPROTOTYPE = kEPROTOTYPEErr, /* Protocol wrong type for socket */ 122 ENOPROTOOPT = kENOPROTOOPTErr, /* Protocol not available */ 123 EPROTONOSUPPORT = kEPROTONOSUPPORTErr, /* Protocol not supported */ 124 ESOCKTNOSUPPORT = kESOCKTNOSUPPORTErr, /* Socket type not supported */ 125 EOPNOTSUPP = kEOPNOTSUPPErr, /* Operation not supported on socket */ 126 EPFNOSUPPORT = kEPFNOSUPPORTErr, /* Protocol family not supported */ 127 EAFNOSUPPORT = kEAFNOSUPPORTErr, /* Address family not supported */ 128 129 EADDRINUSE = kEADDRINUSEErr, /* Address already in use */ 130 EADDRNOTAVAIL = kEADDRNOTAVAILErr, /* Can't assign requested address */ 131 ENETDOWN = kENETDOWNErr, /* No network, check TCP/IP settings */ 132 ENETUNREACH = kENETUNREACHErr, /* Network is unreachable */ 133 ENETRESET = kENETRESETErr, /* Network dropped connection on reset */ 134 135 ECONNABORTED = kECONNABORTEDErr, /* Software caused connection abort */ 136 ECONNRESET = kECONNRESETErr, /* Connection reset by peer */ 137 ENOBUFS = kENOBUFSErr, /* No buffer space available */ 138 EISCONN = kEISCONNErr, /* Socket is already connected */ 139 ENOTCONN = kENOTCONNErr, /* Socket is not connected */ 140 ESHUTDOWN = kESHUTDOWNErr, /* Can't send after socket shutdown */ 141 ETOOMANYREFS = kETOOMANYREFSErr, /* Too many references: can't splice */ 142 ETIMEDOUT = kETIMEDOUTErr, /* Connection timed out */ 143 ECONNREFUSED = kECONNREFUSEDErr, /* Connection refused */ 144 EHOSTDOWN = kEHOSTDOWNErr, /* Host is down */ 145 EHOSTUNREACH = kEHOSTUNREACHErr, /* No route to host */ 146 EWOULDBLOCK = kEWOULDBLOCKErr, /* Call would block, so was aborted */ 147 EALREADY = kEALREADYErr, /* Operation already in progress */ 148 EINPROGRESS = kEINPROGRESSErr, /* Operation now in progress */ 149 150 EBADDOMAINNAME = kEBADDOMAINNAMEErr, /* Bad domain name in TCP/IP settings */ 151 EBADNAMESERVERS = kEBADNAMESERVERSErr, /* Bad name servers in TCP/IP settings */ 152 ENONETWORK = kENONETWORKErr /* No network: check TCP/IP settings */ 153}; 154 155#endif /* !rez */ 156 157#endif /* _SOCKET_ERRORS_ */ 158