xref: /freebsd/contrib/sendmail/include/sm/errstring.h (revision e2c0e292e8a7ca00ba99bcfccc9e637f45c3e8b1)
140266059SGregory Neil Shapiro /*
25dd76dd0SGregory Neil Shapiro  * Copyright (c) 1998-2001, 2003 Proofpoint, Inc. and its suppliers.
340266059SGregory Neil Shapiro  *	All rights reserved.
440266059SGregory Neil Shapiro  *
540266059SGregory Neil Shapiro  * By using this file, you agree to the terms and conditions set
640266059SGregory Neil Shapiro  * forth in the LICENSE file which can be found at the top level of
740266059SGregory Neil Shapiro  * the sendmail distribution.
840266059SGregory Neil Shapiro  *
94313cc83SGregory Neil Shapiro  *	$Id: errstring.h,v 1.11 2013-11-22 20:51:31 ca Exp $
1040266059SGregory Neil Shapiro  */
1140266059SGregory Neil Shapiro 
1240266059SGregory Neil Shapiro /*
1340266059SGregory Neil Shapiro **  Error codes.
1440266059SGregory Neil Shapiro */
1540266059SGregory Neil Shapiro 
1640266059SGregory Neil Shapiro #ifndef SM_ERRSTRING_H
1740266059SGregory Neil Shapiro # define SM_ERRSTRING_H
1840266059SGregory Neil Shapiro 
19d0cef73dSGregory Neil Shapiro #if defined(__QNX__)
20d0cef73dSGregory Neil Shapiro # define E_PSEUDOBASE	512
21*5b0945b5SGregory Neil Shapiro #endif
22d0cef73dSGregory Neil Shapiro 
2340266059SGregory Neil Shapiro #include <errno.h>
24e92d3f3fSGregory Neil Shapiro #if NEEDINTERRNO
2540266059SGregory Neil Shapiro extern int errno;
26*5b0945b5SGregory Neil Shapiro #endif
2740266059SGregory Neil Shapiro 
2840266059SGregory Neil Shapiro /*
2940266059SGregory Neil Shapiro **  These are used in a few cases where we need some special
3040266059SGregory Neil Shapiro **  error codes, but where the system doesn't provide something
3140266059SGregory Neil Shapiro **  reasonable.  They are printed in sm_errstring.
3240266059SGregory Neil Shapiro */
3340266059SGregory Neil Shapiro 
3440266059SGregory Neil Shapiro #ifndef E_PSEUDOBASE
3540266059SGregory Neil Shapiro # define E_PSEUDOBASE	256
36*5b0945b5SGregory Neil Shapiro #endif
3740266059SGregory Neil Shapiro 
3840266059SGregory Neil Shapiro #define E_SM_OPENTIMEOUT (E_PSEUDOBASE + 0)	/* Timeout on file open */
3940266059SGregory Neil Shapiro #define E_SM_NOSLINK	(E_PSEUDOBASE + 1)	/* Symbolic links not allowed */
4040266059SGregory Neil Shapiro #define E_SM_NOHLINK	(E_PSEUDOBASE + 2)	/* Hard links not allowed */
4140266059SGregory Neil Shapiro #define E_SM_REGONLY	(E_PSEUDOBASE + 3)	/* Regular files only */
4240266059SGregory Neil Shapiro #define E_SM_ISEXEC	(E_PSEUDOBASE + 4)	/* Executable files not allowed */
4340266059SGregory Neil Shapiro #define E_SM_WWDIR	(E_PSEUDOBASE + 5)	/* World writable directory */
4440266059SGregory Neil Shapiro #define E_SM_GWDIR	(E_PSEUDOBASE + 6)	/* Group writable directory */
4540266059SGregory Neil Shapiro #define E_SM_FILECHANGE (E_PSEUDOBASE + 7)	/* File changed after open */
4640266059SGregory Neil Shapiro #define E_SM_WWFILE	(E_PSEUDOBASE + 8)	/* World writable file */
4740266059SGregory Neil Shapiro #define E_SM_GWFILE	(E_PSEUDOBASE + 9)	/* Group writable file */
4840266059SGregory Neil Shapiro #define E_SM_GRFILE	(E_PSEUDOBASE + 10)	/* g readable file */
4940266059SGregory Neil Shapiro #define E_SM_WRFILE	(E_PSEUDOBASE + 11)	/* o readable file */
5040266059SGregory Neil Shapiro #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
5140266059SGregory Neil Shapiro #define E_SMDBBASE	(E_PSEUDOBASE + 40)	/* base for libsmdb errors */
52da7d7b9cSGregory Neil Shapiro #define E_LDAPREALBASE	(E_PSEUDOBASE + 70)	/* start of range for LDAP */
53da7d7b9cSGregory Neil Shapiro #define E_LDAPBASE	(E_LDAPREALBASE + E_LDAP_SHIM)	/* LDAP error zero */
54da7d7b9cSGregory Neil Shapiro #define E_LDAPURLBASE	(E_PSEUDOBASE + 230)	/* base for LDAP URL errors */
5540266059SGregory Neil Shapiro 
56da7d7b9cSGregory Neil Shapiro /*
57da7d7b9cSGregory Neil Shapiro **  OpenLDAP uses small negative errors for internal (non-protocol)
58da7d7b9cSGregory Neil Shapiro **  errors.  We expect them to be between zero and -E_LDAP_SHIM
59da7d7b9cSGregory Neil Shapiro **  (and then offset by E_LDAPBASE).
60da7d7b9cSGregory Neil Shapiro */
61da7d7b9cSGregory Neil Shapiro 
62da7d7b9cSGregory Neil Shapiro #define E_LDAP_SHIM	30
63a7ec597cSGregory Neil Shapiro 
6440266059SGregory Neil Shapiro /* libsmdb */
6540266059SGregory Neil Shapiro #define SMDBE_OK			0
6640266059SGregory Neil Shapiro #define SMDBE_MALLOC			(E_SMDBBASE + 1)
6740266059SGregory Neil Shapiro #define SMDBE_GDBM_IS_BAD		(E_SMDBBASE + 2)
6840266059SGregory Neil Shapiro #define SMDBE_UNSUPPORTED		(E_SMDBBASE + 3)
6940266059SGregory Neil Shapiro #define SMDBE_DUPLICATE			(E_SMDBBASE + 4)
7040266059SGregory Neil Shapiro #define SMDBE_BAD_OPEN			(E_SMDBBASE + 5)
7140266059SGregory Neil Shapiro #define SMDBE_NOT_FOUND			(E_SMDBBASE + 6)
7240266059SGregory Neil Shapiro #define SMDBE_UNKNOWN_DB_TYPE		(E_SMDBBASE + 7)
7340266059SGregory Neil Shapiro #define SMDBE_UNSUPPORTED_DB_TYPE	(E_SMDBBASE + 8)
7440266059SGregory Neil Shapiro #define SMDBE_INCOMPLETE		(E_SMDBBASE + 9)
7540266059SGregory Neil Shapiro #define SMDBE_KEY_EMPTY			(E_SMDBBASE + 10)
7640266059SGregory Neil Shapiro #define SMDBE_KEY_EXIST			(E_SMDBBASE + 11)
7740266059SGregory Neil Shapiro #define SMDBE_LOCK_DEADLOCK		(E_SMDBBASE + 12)
7840266059SGregory Neil Shapiro #define SMDBE_LOCK_NOT_GRANTED		(E_SMDBBASE + 13)
7940266059SGregory Neil Shapiro #define SMDBE_LOCK_NOT_HELD		(E_SMDBBASE + 14)
8040266059SGregory Neil Shapiro #define SMDBE_RUN_RECOVERY		(E_SMDBBASE + 15)
8140266059SGregory Neil Shapiro #define SMDBE_IO_ERROR			(E_SMDBBASE + 16)
8240266059SGregory Neil Shapiro #define SMDBE_READ_ONLY			(E_SMDBBASE + 17)
8340266059SGregory Neil Shapiro #define SMDBE_DB_NAME_TOO_LONG		(E_SMDBBASE + 18)
8440266059SGregory Neil Shapiro #define SMDBE_INVALID_PARAMETER		(E_SMDBBASE + 19)
8540266059SGregory Neil Shapiro #define SMDBE_ONLY_SUPPORTS_ONE_CURSOR	(E_SMDBBASE + 20)
8640266059SGregory Neil Shapiro #define SMDBE_NOT_A_VALID_CURSOR	(E_SMDBBASE + 21)
8740266059SGregory Neil Shapiro #define SMDBE_LAST_ENTRY		(E_SMDBBASE + 22)
8840266059SGregory Neil Shapiro #define SMDBE_OLD_VERSION		(E_SMDBBASE + 23)
89a7ec597cSGregory Neil Shapiro #define SMDBE_VERSION_MISMATCH		(E_SMDBBASE + 24)
9040266059SGregory Neil Shapiro 
91*5b0945b5SGregory Neil Shapiro extern const char *sm_errstring __P((int _errnum));
9240266059SGregory Neil Shapiro 
9340266059SGregory Neil Shapiro #endif /* SM_ERRSTRING_H */
94