]>
git.ipfire.org Git - thirdparty/squid.git/blob - lib/snmplib/snmp_api_error.c
2 * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
10 * Error routines concerning the error status of the SNMP API.
12 * Sometimes things don't work out the way we wanted.
15 /***************************************************************************
17 * Copyright 1997 by Carnegie Mellon University
21 * Permission to use, copy, modify, and distribute this software and its
22 * documentation for any purpose and without fee is hereby granted,
23 * provided that the above copyright notice appear in all copies and that
24 * both that copyright notice and this permission notice appear in
25 * supporting documentation, and that the name of CMU not be
26 * used in advertising or publicity pertaining to distribution of the
27 * software without specific, written prior permission.
29 * CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
30 * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
31 * CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
32 * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
33 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
34 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
37 * Author: Ryan Troll <ryan+@andrew.cmu.edu>
39 ***************************************************************************/
42 #include "snmp_api_error.h"
46 static const char *api_errors
[17] = {
54 "Encoding ASN.1 Information", /* 6 */
55 "Decoding ASN.1 Information", /* 7 */
56 "PDU Translation error",
58 "Invalid Textual OID",
61 "Unsupported SNMP Type",
62 "Unable to parse PDU",
64 "No Response From Host",
70 snmp_set_api_error(int x
)
76 snmp_api_error(int err
)
79 if ((foo
< SNMPERR_GENERR
) ||
83 return (api_errors
[foo
]);
93 api_errstring(int snmp_errnumber
)
95 return (snmp_api_error(snmp_errnumber
));