]> git.ipfire.org Git - thirdparty/squid.git/blob - include/snmp_api_error.h
Merged from trunk
[thirdparty/squid.git] / include / snmp_api_error.h
1 /* -*- c++ -*- */
2 #ifndef SQUID_SNMP_API_ERROR_H
3 #define SQUID_SNMP_API_ERROR_H
4
5 /***************************************************************************
6 *
7 * Copyright 1997 by Carnegie Mellon University
8 *
9 * All Rights Reserved
10 *
11 * Permission to use, copy, modify, and distribute this software and its
12 * documentation for any purpose and without fee is hereby granted,
13 * provided that the above copyright notice appear in all copies and that
14 * both that copyright notice and this permission notice appear in
15 * supporting documentation, and that the name of CMU not be
16 * used in advertising or publicity pertaining to distribution of the
17 * software without specific, written prior permission.
18 *
19 * CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
20 * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
21 * CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
22 * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
23 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
24 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
25 * SOFTWARE.
26 *
27 * Author: Ryan Troll <ryan+@andrew.cmu.edu>
28 *
29 ***************************************************************************/
30
31 /* Error return values */
32 #define SNMPERR_GENERR -1
33 #define SNMPERR_BAD_LOCPORT -2 /* local port was already in use */
34 #define SNMPERR_BAD_ADDRESS -3
35 #define SNMPERR_BAD_SESSION -4
36 #define SNMPERR_TOO_LONG -5 /* data too long for provided buffer */
37
38 #define SNMPERR_ASN_ENCODE -6
39 #define SNMPERR_ASN_DECODE -7
40 #define SNMPERR_PDU_TRANSLATION -8
41 #define SNMPERR_OS_ERR -9
42 #define SNMPERR_INVALID_TXTOID -10
43
44 #define SNMPERR_UNABLE_TO_FIX -11
45 #define SNMPERR_UNSUPPORTED_TYPE -12
46 #define SNMPERR_PDU_PARSE -13
47 #define SNMPERR_PACKET_ERR -14
48 #define SNMPERR_NO_RESPONSE -15
49
50 #define SNMPERR_LAST -16 /* Last error message */
51
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55
56 /* extern int snmp_errno */
57
58 const char *snmp_api_error(int);
59 int snmp_api_errno(void);
60
61 const char *api_errstring(int); /* Backwards compatibility */
62 void snmp_set_api_error(int);
63
64 #ifdef __cplusplus
65 }
66
67 #endif
68
69 #endif /* SQUID_SNMP_API_ERROR_H */