From c2fb281de3dcbc03e65a33cbb05adaaef5b3f45a Mon Sep 17 00:00:00 2001 From: John Gilmore Date: Wed, 29 Mar 1995 02:12:14 +0000 Subject: * k5-errors.h: Rename errors.h (which duplicated a standard Mac header name, causing a problem). * AddressXlation.h, GetMyIPAddr.h, MacTCPCommonTypes.h, TCPPB.h, UDPPB.h: Add MacTCP header files. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5293 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/krb5/AddressXlation.h | 102 ++++++++++++++ src/include/krb5/ChangeLog | 5 + src/include/krb5/GetMyIPAddr.h | 37 ++++++ src/include/krb5/MacTCPCommonTypes.h | 112 ++++++++++++++++ src/include/krb5/TCPPB.h | 248 +++++++++++++++++++++++++++++++++++ src/include/krb5/UDPPB.h | 84 ++++++++++++ src/include/krb5/errors.h | 95 -------------- src/include/krb5/k5-errors.h | 95 ++++++++++++++ 8 files changed, 683 insertions(+), 95 deletions(-) create mode 100644 src/include/krb5/AddressXlation.h create mode 100644 src/include/krb5/GetMyIPAddr.h create mode 100644 src/include/krb5/MacTCPCommonTypes.h create mode 100644 src/include/krb5/TCPPB.h create mode 100644 src/include/krb5/UDPPB.h delete mode 100644 src/include/krb5/errors.h create mode 100644 src/include/krb5/k5-errors.h diff --git a/src/include/krb5/AddressXlation.h b/src/include/krb5/AddressXlation.h new file mode 100644 index 000000000..b73055b98 --- /dev/null +++ b/src/include/krb5/AddressXlation.h @@ -0,0 +1,102 @@ +/* + AddressXlation.h + MacTCP name to address translation routines. + + Copyright Apple Computer, Inc. 1988-91 + All rights reserved + +*/ +#ifndef __ADDRESSXLATION__ +#define __ADDRESSXLATION__ + +#ifndef __MACTCPCOMMONTYPES__ +#include "MacTCPCommonTypes.h" +#endif + +#define NUM_ALT_ADDRS 4 + +typedef struct hostInfo { + long rtnCode; + char cname[255]; + unsigned long addr[NUM_ALT_ADDRS]; +}; + +typedef enum AddrClasses { + A = 1, + NS, + CNAME = 5, + HINFO = 13, + MX = 15, + lastClass = 32767 +} AddrClasses; + +typedef struct HInfoRec { + char cpuType[30]; + char osType[30]; + }; + +typedef struct MXRec { + unsigned short preference; + char exchange[255]; + }; + +typedef struct returnRec { + long rtnCode; + char cname[255]; + union { + unsigned long addr[NUM_ALT_ADDRS]; + struct HInfoRec hinfo; + struct MXRec mx; + } rdata; +}; + +typedef struct cacheEntryRecord { + char *cname; + unsigned short type; + unsigned short cacheClass; + unsigned long ttl; + union { + char *name; + ip_addr addr; + } rdata; +}; + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef THINK_C + + typedef ProcPtr EnumResultProcPtr; + typedef ProcPtr ResultProcPtr; + typedef ProcPtr ResultProc2Ptr; + +#else + + typedef pascal void (*EnumResultProcPtr)(struct cacheEntryRecord *cacheEntryRecordPtr, char *userDataPtr); + typedef pascal void (*ResultProcPtr)(struct hostInfo *hostInfoPtr, char *userDataPtr); + typedef pascal void (*ResultProc2Ptr)(struct returnRec *returnRecPtr, char *userDataPtr); + +#endif + +extern OSErr OpenResolver(char *fileName); + +extern OSErr StrToAddr(char *hostName, struct hostInfo *hostInfoPtr, ResultProcPtr ResultProc, char *userDataPtr); + +extern OSErr AddrToStr(unsigned long addr, char *addrStr); + +extern OSErr EnumCache(EnumResultProcPtr enumResultProc, char *userDataPtr); + +extern OSErr AddrToName(ip_addr addr, struct hostInfo *hostInfoPtr, ResultProcPtr ResultProc, char *userDataPtr); + +extern OSErr HInfo(char *hostName, struct returnRec *returnRecPtr, ResultProc2Ptr resultProc, char *userDataPtr); + +extern OSErr MXInfo(char *hostName, struct returnRec *returnRecPtr, ResultProc2Ptr resultProc, char *userDataPtr); + +extern OSErr CloseResolver(void); + +#ifdef __cplusplus +} +#endif + +#endif /* __ADDRESSXLATION__ */ diff --git a/src/include/krb5/ChangeLog b/src/include/krb5/ChangeLog index 69152b0bd..482fdd035 100644 --- a/src/include/krb5/ChangeLog +++ b/src/include/krb5/ChangeLog @@ -9,6 +9,11 @@ Tue Mar 28 18:02:41 1995 John Gilmore (gnu at toad.com) * macsock.h: Support connect(), recv(), send(), getmyipaddr(). (WSAGetLastError): Fix typo -- there's no argument to this macro. + * k5-errors.h: Rename errors.h (which duplicated a standard Mac + header name, causing a problem). + * AddressXlation.h, GetMyIPAddr.h, MacTCPCommonTypes.h, TCPPB.h, + UDPPB.h: Add MacTCP header files. + Mon Mar 27 09:33:10 1995 Chris Provenzano (proven@mit.edu) * func-proto.h (krb5_rd_req(), krb5_rd_req_decode(), krb5_mk_rep(), diff --git a/src/include/krb5/GetMyIPAddr.h b/src/include/krb5/GetMyIPAddr.h new file mode 100644 index 000000000..0727c3b4c --- /dev/null +++ b/src/include/krb5/GetMyIPAddr.h @@ -0,0 +1,37 @@ +/* + GetMyIPAddr.h + C definitions of parameter block entries needed for IP calls + + Copyright Apple Computer, Inc. 1989 + All rights reserved + +*/ + +#ifndef __GETMYIPADDR__ +#define __GETMYIPADDR__ + +#ifndef __MACTCPCOMMONTYPES__ +#include "MacTCPCommonTypes.h" +#endif + +#define ipctlGetAddr 15 /* csCode to get our IP address */ + +#define GetIPParamBlockHeader \ + struct QElem *qLink; \ + short qType; \ + short ioTrap; \ + Ptr ioCmdAddr; \ + ProcPtr ioCompletion; \ + OSErr ioResult; \ + StringPtr ioNamePtr; \ + short ioVRefNum; \ + short ioCRefNum; \ + short csCode + +struct GetAddrParamBlock { + GetIPParamBlockHeader; /* standard I/O header */ + ip_addr ourAddress; /* our IP address */ + long ourNetMask; /* our IP net mask */ + }; + +#endif diff --git a/src/include/krb5/MacTCPCommonTypes.h b/src/include/krb5/MacTCPCommonTypes.h new file mode 100644 index 000000000..b62ae262d --- /dev/null +++ b/src/include/krb5/MacTCPCommonTypes.h @@ -0,0 +1,112 @@ +/* + MacTCPCommonTypes.h + C type definitions used throughout MacTCP. + + Copyright Apple Computer, Inc. 1988-91 + All rights reserved + +*/ + +#ifndef __MACTCPCOMMONTYPES__ +#define __MACTCPCOMMONTYPES__ + +#ifndef __TYPES__ +#include +#endif /* __TYPES__ */ + +/* MacTCP return Codes in the range -23000 through -23049 */ +#define inProgress 1 /* I/O in progress */ + +#define ipBadLapErr -23000 /* bad network configuration */ +#define ipBadCnfgErr -23001 /* bad IP configuration error */ +#define ipNoCnfgErr -23002 /* missing IP or LAP configuration error */ +#define ipLoadErr -23003 /* error in MacTCP load */ +#define ipBadAddr -23004 /* error in getting address */ +#define connectionClosing -23005 /* connection is closing */ +#define invalidLength -23006 +#define connectionExists -23007 /* request conflicts with existing connection */ +#define connectionDoesntExist -23008 /* connection does not exist */ +#define insufficientResources -23009 /* insufficient resources to perform request */ +#define invalidStreamPtr -23010 +#define streamAlreadyOpen -23011 +#define connectionTerminated -23012 +#define invalidBufPtr -23013 +#define invalidRDS -23014 +#define invalidWDS -23014 +#define openFailed -23015 +#define commandTimeout -23016 +#define duplicateSocket -23017 + +/* Error codes from internal IP functions */ +#define ipDontFragErr -23032 /* Packet too large to send w/o fragmenting */ +#define ipDestDeadErr -23033 /* destination not responding */ +#define icmpEchoTimeoutErr -23035 /* ICMP echo timed-out */ +#define ipNoFragMemErr -23036 /* no memory to send fragmented pkt */ +#define ipRouteErr -23037 /* can't route packet off-net */ + +#define nameSyntaxErr -23041 +#define cacheFault -23042 +#define noResultProc -23043 +#define noNameServer -23044 +#define authNameErr -23045 +#define noAnsErr -23046 +#define dnrErr -23047 +#define outOfMemory -23048 + +#define BYTES_16WORD 2 /* bytes per 16 bit ip word */ +#define BYTES_32WORD 4 /* bytes per 32 bit ip word */ +#define BYTES_64WORD 8 /* bytes per 64 bit ip word */ + +typedef unsigned char b_8; /* 8-bit quantity */ +typedef unsigned short b_16; /* 16-bit quantity */ +typedef unsigned long b_32; /* 32-bit quantity */ + +typedef b_32 ip_addr; /* IP address is 32-bits */ + +typedef struct ip_addrbytes { + union { + b_32 addr; + char byte[4]; + } a; + } ip_addrbytes; + +typedef struct wdsEntry { + unsigned short length; /* length of buffer */ + char * ptr; /* pointer to buffer */ + } wdsEntry; + +typedef struct rdsEntry { + unsigned short length; /* length of buffer */ + char * ptr; /* pointer to buffer */ + } rdsEntry; + +typedef unsigned long BufferPtr; + +typedef unsigned long StreamPtr; + +typedef enum ICMPMsgType { + netUnreach, hostUnreach, protocolUnreach, portUnreach, fragReqd, + sourceRouteFailed, timeExceeded, parmProblem, missingOption, + lastICMPMsgType = 32767 + } ICMPMsgType; + +typedef b_16 ip_port; + +typedef struct ICMPReport { + StreamPtr streamPtr; + ip_addr localHost; + ip_port localPort; + ip_addr remoteHost; + ip_port remotePort; + short reportType; + unsigned short optionalAddlInfo; + unsigned long optionalAddlInfoPtr; + } ICMPReport; + + +typedef OSErr (*OSErrProcPtr)(); +typedef Ptr (*PtrProcPtr)(); +typedef Boolean (*BooleanProcPtr)(); +typedef void (*voidProcPtr)(); + +#endif /* __MACTCPCOMMONTYPES__ */ diff --git a/src/include/krb5/TCPPB.h b/src/include/krb5/TCPPB.h new file mode 100644 index 000000000..2a4afbb94 --- /dev/null +++ b/src/include/krb5/TCPPB.h @@ -0,0 +1,248 @@ +/* + TCPPB.h + C definitions of parameter block entries needed for TCP calls + + Copyright Apple Computer, Inc. 1988-91 + All rights reserved + +*/ + + +/* Command codes */ + +#define TCPCreate 30 +#define TCPPassiveOpen 31 +#define TCPActiveOpen 32 +#define TCPSend 34 +#define TCPNoCopyRcv 35 +#define TCPRcvBfrReturn 36 +#define TCPRcv 37 +#define TCPClose 38 +#define TCPAbort 39 +#define TCPStatus 40 +#define TCPExtendedStat 41 +#define TCPRelease 42 +#define TCPGlobalInfo 43 +#define TCPCtlMax 49 + +typedef enum TCPEventCode { + TCPClosing = 1, + TCPULPTimeout, + TCPTerminate, + TCPDataArrival, + TCPUrgent, + TCPICMPReceived, + lastEvent = 32767 +} TCPEventCode; + +typedef enum TCPTerminationReason { + TCPRemoteAbort = 2, + TCPNetworkFailure, + TCPSecPrecMismatch, + TCPULPTimeoutTerminate, + TCPULPAbort, + TCPULPClose, + TCPServiceError, + lastReason = 32767 +} TCPTerminationReason; + +#ifdef THINK_C +typedef ProcPtr TCPNotifyProc; +#else +typedef pascal void (*TCPNotifyProc) ( + StreamPtr tcpStream, + unsigned short eventCode, + Ptr userDataPtr, + unsigned short terminReason, + struct ICMPReport *icmpMsg); +#endif + +typedef void (*TCPIOCompletionProc) (struct TCPiopb *iopb); + +typedef unsigned short tcp_port; + +typedef unsigned char byte; + +enum { /* ValidityFlags */ + timeoutValue = 0x80, + timeoutAction = 0x40, + typeOfService = 0x20, + precedence = 0x10 +}; + +enum { /* TOSFlags */ + lowDelay = 0x01, + throughPut = 0x02, + reliability = 0x04 +}; + +typedef struct TCPCreatePB { + Ptr rcvBuff; + unsigned long rcvBuffLen; + TCPNotifyProc notifyProc; + Ptr userDataPtr; +}TCPCreatePB; + +typedef struct TCPOpenPB { + byte ulpTimeoutValue; + byte ulpTimeoutAction; + byte validityFlags; + byte commandTimeoutValue; + ip_addr remoteHost; + tcp_port remotePort; + ip_addr localHost; + tcp_port localPort; + byte tosFlags; + byte precedence; + Boolean dontFrag; + byte timeToLive; + byte security; + byte optionCnt; + byte options[40]; + Ptr userDataPtr; +}TCPOpenPB; + +typedef struct TCPSendPB { + byte ulpTimeoutValue; + byte ulpTimeoutAction; + byte validityFlags; + Boolean pushFlag; + Boolean urgentFlag; + Ptr wdsPtr; + unsigned long sendFree; + unsigned short sendLength; + Ptr userDataPtr; +}TCPSendPB; + + +typedef struct TCPReceivePB { /* for receive and return rcv buff calls */ + byte commandTimeoutValue; + byte filler; + Boolean markFlag; + Boolean urgentFlag; + Ptr rcvBuff; + unsigned short rcvBuffLen; + Ptr rdsPtr; + unsigned short rdsLength; + unsigned short secondTimeStamp; + Ptr userDataPtr; +}TCPReceivePB; + +typedef struct TCPClosePB { + byte ulpTimeoutValue; + byte ulpTimeoutAction; + byte validityFlags; + Ptr userDataPtr; +}TCPClosePB; + +typedef struct HistoBucket { + unsigned short value; + unsigned long counter; +}; + +#define NumOfHistoBuckets 7 + +typedef struct TCPConnectionStats { + unsigned long dataPktsRcvd; + unsigned long dataPktsSent; + unsigned long dataPktsResent; + unsigned long bytesRcvd; + unsigned long bytesRcvdDup; + unsigned long bytesRcvdPastWindow; + unsigned long bytesSent; + unsigned long bytesResent; + unsigned short numHistoBuckets; + struct HistoBucket sentSizeHisto[NumOfHistoBuckets]; + unsigned short lastRTT; + unsigned short tmrSRTT; + unsigned short rttVariance; + unsigned short tmrRTO; + byte sendTries; + byte sourchQuenchRcvd; +}TCPConnectionStats; + +typedef struct TCPStatusPB { + byte ulpTimeoutValue; + byte ulpTimeoutAction; + long unused; + ip_addr remoteHost; + tcp_port remotePort; + ip_addr localHost; + tcp_port localPort; + byte tosFlags; + byte precedence; + byte connectionState; + unsigned short sendWindow; + unsigned short rcvWindow; + unsigned short amtUnackedData; + unsigned short amtUnreadData; + Ptr securityLevelPtr; + unsigned long sendUnacked; + unsigned long sendNext; + unsigned long congestionWindow; + unsigned long rcvNext; + unsigned long srtt; + unsigned long lastRTT; + unsigned long sendMaxSegSize; + struct TCPConnectionStats *connStatPtr; + Ptr userDataPtr; +}TCPStatusPB; + +typedef struct TCPAbortPB { + Ptr userDataPtr; +}TCPAbortPB; + +typedef struct TCPParam { + unsigned long tcpRtoA; + unsigned long tcpRtoMin; + unsigned long tcpRtoMax; + unsigned long tcpMaxSegSize; + unsigned long tcpMaxConn; + unsigned long tcpMaxWindow; +}TCPParam; + +typedef struct TCPStats { + unsigned long tcpConnAttempts; + unsigned long tcpConnOpened; + unsigned long tcpConnAccepted; + unsigned long tcpConnClosed; + unsigned long tcpConnAborted; + unsigned long tcpOctetsIn; + unsigned long tcpOctetsOut; + unsigned long tcpOctetsInDup; + unsigned long tcpOctetsRetrans; + unsigned long tcpInputPkts; + unsigned long tcpOutputPkts; + unsigned long tcpDupPkts; + unsigned long tcpRetransPkts; +}TCPStats; + +typedef struct TCPGlobalInfoPB { + struct TCPParam *tcpParamPtr; + struct TCPStats *tcpStatsPtr; + StreamPtr *tcpCDBTable[]; + Ptr userDataPtr; + unsigned short maxTCPConnections; +}TCPGlobalInfoPB; + +typedef struct TCPiopb { + char fill12[12]; + TCPIOCompletionProc ioCompletion; + short ioResult; + char *ioNamePtr; + short ioVRefNum; + short ioCRefNum; + short csCode; + StreamPtr tcpStream; + union { + struct TCPCreatePB create; + struct TCPOpenPB open; + struct TCPSendPB send; + struct TCPReceivePB receive; + struct TCPClosePB close; + struct TCPAbortPB abort; + struct TCPStatusPB status; + struct TCPGlobalInfoPB globalInfo; + } csParam; +}TCPiopb; + diff --git a/src/include/krb5/UDPPB.h b/src/include/krb5/UDPPB.h new file mode 100644 index 000000000..a4e3fcdc2 --- /dev/null +++ b/src/include/krb5/UDPPB.h @@ -0,0 +1,84 @@ +/* + UDPPB.h + C definitions of parameter block entries needed for UDP calls + + Copyright Apple Computer, Inc. 1988-89 + All rights reserved + +*/ + +#define UDPCreate 20 +#define UDPRead 21 +#define UDPBfrReturn 22 +#define UDPWrite 23 +#define UDPRelease 24 +#define UDPMaxMTUSize 25 +#define UDPCtlMax 29 + +typedef enum UDPEventCode { + UDPDataArrival = 1, + UDPICMPReceived, + lastUDPEvent = 65535 + }; + +typedef pascal void (*UDPNotifyProc) ( + StreamPtr udpStream, + unsigned short eventCode, + Ptr userDataPtr, + struct ICMPReport *icmpMsg); + +typedef void (*UDPIOCompletionProc) (struct UDPiopb *iopb); + +typedef unsigned short udp_port; + +typedef struct UDPCreatePB { /* for create and release calls */ + Ptr rcvBuff; + unsigned long rcvBuffLen; + UDPNotifyProc notifyProc; + unsigned short localPort; + Ptr userDataPtr; +} UDPCreatePB; + +typedef struct UDPSendPB { + unsigned short reserved; + ip_addr remoteHost; + udp_port remotePort; + Ptr wdsPtr; + Boolean checkSum; + unsigned short sendLength; + Ptr userDataPtr; +} UDPSendPB; + +typedef struct UDPReceivePB { /* for receive and buffer return calls */ + unsigned short timeOut; + ip_addr remoteHost; + udp_port remotePort; + Ptr rcvBuff; + unsigned short rcvBuffLen; + unsigned short secondTimeStamp; + Ptr userDataPtr; +} UDPReceivePB; + +typedef struct UDPMTUPB { + unsigned short mtuSize; + ip_addr remoteHost; + Ptr userDataPtr; +} UDPMTUPB; + +typedef struct UDPiopb { + char fill12[12]; + UDPIOCompletionProc ioCompletion; + short ioResult; + char *ioNamePtr; + short ioVRefNum; + short ioCRefNum; + short csCode; + StreamPtr udpStream; + union { + struct UDPCreatePB create; + struct UDPSendPB send; + struct UDPReceivePB receive; + struct UDPMTUPB mtu; + } csParam; +} UDPiopb; + diff --git a/src/include/krb5/errors.h b/src/include/krb5/errors.h deleted file mode 100644 index 42321a892..000000000 --- a/src/include/krb5/errors.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * include/krb5/errors.h - * - * Copyright 1989,1990 by the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * Export of this software from the United States of America may - * require a specific license from the United States Government. - * It is the responsibility of any person or organization contemplating - * export to obtain such a license before exporting. - * - * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and - * distribute this software and its documentation for any purpose and - * without fee is hereby granted, provided that the above copyright - * notice appear in all copies and that both that copyright notice and - * this permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity pertaining - * to distribution of the software without specific, written prior - * permission. M.I.T. makes no representations about the suitability of - * this software for any purpose. It is provided "as is" without express - * or implied warranty. - * - * - * Protocol error code definitions - */ - - -#ifndef KRB5_ERRORS__ -#define KRB5_ERRORS__ - - -/* Error codes used in KRB_ERROR protocol messages. - Return values of library routines are based on a different error table - (which allows non-ambiguous error codes between subsystems) */ - -/* KDC errors */ -#define KDC_ERR_NONE 0 /* No error */ -#define KDC_ERR_NAME_EXP 1 /* Client's entry in DB expired */ -#define KDC_ERR_SERVICE_EXP 2 /* Server's entry in DB expired */ -#define KDC_ERR_BAD_PVNO 3 /* Requested pvno not supported */ -#define KDC_ERR_C_OLD_MAST_KVNO 4 /* C's key encrypted in old master */ -#define KDC_ERR_S_OLD_MAST_KVNO 5 /* S's key encrypted in old master */ -#define KDC_ERR_C_PRINCIPAL_UNKNOWN 6 /* Client not found in Kerberos DB */ -#define KDC_ERR_S_PRINCIPAL_UNKNOWN 7 /* Server not found in Kerberos DB */ -#define KDC_ERR_PRINCIPAL_NOT_UNIQUE 8 /* Multiple entries in Kerberos DB */ -#define KDC_ERR_NULL_KEY 9 /* The C or S has a null key */ -#define KDC_ERR_CANNOT_POSTDATE 10 /* Tkt ineligible for postdating */ -#define KDC_ERR_NEVER_VALID 11 /* Requested starttime > endtime */ -#define KDC_ERR_POLICY 12 /* KDC policy rejects request */ -#define KDC_ERR_BADOPTION 13 /* KDC can't do requested opt. */ -#define KDC_ERR_ETYPE_NOSUPP 14 /* No support for encryption type */ -#define KDC_ERR_SUMTYPE_NOSUPP 15 /* No support for checksum type */ -#define KDC_ERR_PADATA_TYPE_NOSUPP 16 /* No support for padata type */ -#define KDC_ERR_TRTYPE_NOSUPP 17 /* No support for transited type */ -#define KDC_ERR_CLIENT_REVOKED 18 /* C's creds have been revoked */ -#define KDC_ERR_SERVICE_REVOKED 19 /* S's creds have been revoked */ -#define KDC_ERR_TGT_REVOKED 20 /* TGT has been revoked */ -#define KDC_ERR_CLIENT_NOTYET 21 /* C not yet valid */ -#define KDC_ERR_SERVICE_NOTYET 22 /* S not yet valid */ -#define KDC_ERR_KEY_EXP 23 /* Password has expired */ -#define KDC_ERR_PREAUTH_FAILED 24 /* Preauthentication failed */ -#define KDC_ERR_PREAUTH_REQUIRED 25 /* Additional preauthentication */ - /* required */ -#define KDC_ERR_SERVER_NOMATCH 26 /* Requested server and */ - /* ticket don't match*/ -/* Application errors */ -#define KRB_AP_ERR_BAD_INTEGRITY 31 /* Decrypt integrity check failed */ -#define KRB_AP_ERR_TKT_EXPIRED 32 /* Ticket expired */ -#define KRB_AP_ERR_TKT_NYV 33 /* Ticket not yet valid */ -#define KRB_AP_ERR_REPEAT 34 /* Request is a replay */ -#define KRB_AP_ERR_NOT_US 35 /* The ticket isn't for us */ -#define KRB_AP_ERR_BADMATCH 36 /* Ticket/authenticator don't match */ -#define KRB_AP_ERR_SKEW 37 /* Clock skew too great */ -#define KRB_AP_ERR_BADADDR 38 /* Incorrect net address */ -#define KRB_AP_ERR_BADVERSION 39 /* Protocol version mismatch */ -#define KRB_AP_ERR_MSG_TYPE 40 /* Invalid message type */ -#define KRB_AP_ERR_MODIFIED 41 /* Message stream modified */ -#define KRB_AP_ERR_BADORDER 42 /* Message out of order */ -#define KRB_AP_ERR_BADKEYVER 44 /* Key version is not available */ -#define KRB_AP_ERR_NOKEY 45 /* Service key not available */ -#define KRB_AP_ERR_MUT_FAIL 46 /* Mutual authentication failed */ -#define KRB_AP_ERR_BADDIRECTION 47 /* Incorrect message direction */ -#define KRB_AP_ERR_METHOD 48 /* Alternative authentication */ - /* method required */ -#define KRB_AP_ERR_BADSEQ 49 /* Incorrect sequence numnber */ - /* in message */ -#define KRB_AP_ERR_INAPP_CKSUM 50 /* Inappropriate type of */ - /* checksum in message */ - -/* other errors */ -#define KRB_ERR_GENERIC 60 /* Generic error (description */ - /* in e-text) */ -#define KRB_ERR_FIELD_TOOLONG 61 /* Field is too long for impl. */ - -#endif /* KRB5_ERRORS__ */ diff --git a/src/include/krb5/k5-errors.h b/src/include/krb5/k5-errors.h new file mode 100644 index 000000000..42321a892 --- /dev/null +++ b/src/include/krb5/k5-errors.h @@ -0,0 +1,95 @@ +/* + * include/krb5/errors.h + * + * Copyright 1989,1990 by the Massachusetts Institute of Technology. + * All Rights Reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + * + * + * Protocol error code definitions + */ + + +#ifndef KRB5_ERRORS__ +#define KRB5_ERRORS__ + + +/* Error codes used in KRB_ERROR protocol messages. + Return values of library routines are based on a different error table + (which allows non-ambiguous error codes between subsystems) */ + +/* KDC errors */ +#define KDC_ERR_NONE 0 /* No error */ +#define KDC_ERR_NAME_EXP 1 /* Client's entry in DB expired */ +#define KDC_ERR_SERVICE_EXP 2 /* Server's entry in DB expired */ +#define KDC_ERR_BAD_PVNO 3 /* Requested pvno not supported */ +#define KDC_ERR_C_OLD_MAST_KVNO 4 /* C's key encrypted in old master */ +#define KDC_ERR_S_OLD_MAST_KVNO 5 /* S's key encrypted in old master */ +#define KDC_ERR_C_PRINCIPAL_UNKNOWN 6 /* Client not found in Kerberos DB */ +#define KDC_ERR_S_PRINCIPAL_UNKNOWN 7 /* Server not found in Kerberos DB */ +#define KDC_ERR_PRINCIPAL_NOT_UNIQUE 8 /* Multiple entries in Kerberos DB */ +#define KDC_ERR_NULL_KEY 9 /* The C or S has a null key */ +#define KDC_ERR_CANNOT_POSTDATE 10 /* Tkt ineligible for postdating */ +#define KDC_ERR_NEVER_VALID 11 /* Requested starttime > endtime */ +#define KDC_ERR_POLICY 12 /* KDC policy rejects request */ +#define KDC_ERR_BADOPTION 13 /* KDC can't do requested opt. */ +#define KDC_ERR_ETYPE_NOSUPP 14 /* No support for encryption type */ +#define KDC_ERR_SUMTYPE_NOSUPP 15 /* No support for checksum type */ +#define KDC_ERR_PADATA_TYPE_NOSUPP 16 /* No support for padata type */ +#define KDC_ERR_TRTYPE_NOSUPP 17 /* No support for transited type */ +#define KDC_ERR_CLIENT_REVOKED 18 /* C's creds have been revoked */ +#define KDC_ERR_SERVICE_REVOKED 19 /* S's creds have been revoked */ +#define KDC_ERR_TGT_REVOKED 20 /* TGT has been revoked */ +#define KDC_ERR_CLIENT_NOTYET 21 /* C not yet valid */ +#define KDC_ERR_SERVICE_NOTYET 22 /* S not yet valid */ +#define KDC_ERR_KEY_EXP 23 /* Password has expired */ +#define KDC_ERR_PREAUTH_FAILED 24 /* Preauthentication failed */ +#define KDC_ERR_PREAUTH_REQUIRED 25 /* Additional preauthentication */ + /* required */ +#define KDC_ERR_SERVER_NOMATCH 26 /* Requested server and */ + /* ticket don't match*/ +/* Application errors */ +#define KRB_AP_ERR_BAD_INTEGRITY 31 /* Decrypt integrity check failed */ +#define KRB_AP_ERR_TKT_EXPIRED 32 /* Ticket expired */ +#define KRB_AP_ERR_TKT_NYV 33 /* Ticket not yet valid */ +#define KRB_AP_ERR_REPEAT 34 /* Request is a replay */ +#define KRB_AP_ERR_NOT_US 35 /* The ticket isn't for us */ +#define KRB_AP_ERR_BADMATCH 36 /* Ticket/authenticator don't match */ +#define KRB_AP_ERR_SKEW 37 /* Clock skew too great */ +#define KRB_AP_ERR_BADADDR 38 /* Incorrect net address */ +#define KRB_AP_ERR_BADVERSION 39 /* Protocol version mismatch */ +#define KRB_AP_ERR_MSG_TYPE 40 /* Invalid message type */ +#define KRB_AP_ERR_MODIFIED 41 /* Message stream modified */ +#define KRB_AP_ERR_BADORDER 42 /* Message out of order */ +#define KRB_AP_ERR_BADKEYVER 44 /* Key version is not available */ +#define KRB_AP_ERR_NOKEY 45 /* Service key not available */ +#define KRB_AP_ERR_MUT_FAIL 46 /* Mutual authentication failed */ +#define KRB_AP_ERR_BADDIRECTION 47 /* Incorrect message direction */ +#define KRB_AP_ERR_METHOD 48 /* Alternative authentication */ + /* method required */ +#define KRB_AP_ERR_BADSEQ 49 /* Incorrect sequence numnber */ + /* in message */ +#define KRB_AP_ERR_INAPP_CKSUM 50 /* Inappropriate type of */ + /* checksum in message */ + +/* other errors */ +#define KRB_ERR_GENERIC 60 /* Generic error (description */ + /* in e-text) */ +#define KRB_ERR_FIELD_TOOLONG 61 /* Field is too long for impl. */ + +#endif /* KRB5_ERRORS__ */ -- cgit