snmp_error.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
3  *
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.
7  */
8 
9 /*
10  * The possible SNMP Error messages, from the SNMP Protocol Operations
11  * [ RFC 1905 ]
12  */
13 /**********************************************************************
14  *
15  * Copyright 1997 by Carnegie Mellon University
16  *
17  * All Rights Reserved
18  *
19  * Permission to use, copy, modify, and distribute this software and its
20  * documentation for any purpose and without fee is hereby granted,
21  * provided that the above copyright notice appear in all copies and that
22  * both that copyright notice and this permission notice appear in
23  * supporting documentation, and that the name of CMU not be
24  * used in advertising or publicity pertaining to distribution of the
25  * software without specific, written prior permission.
26  *
27  * CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
28  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
29  * CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
30  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
31  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
32  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
33  * SOFTWARE.
34  *
35  **********************************************************************/
36 
37 #include "squid.h"
38 #include "snmp_error.h"
39 
40 static const char *error_string[25] = {
41  /* 0x00 - 0x05 */
42  "No Error",
43  "Response message would have been too large.",
44  "There is no such variable name in this MIB.",
45  "The value given has the wrong type, length, or value",
46  "This variable is read only",
47  "A general failure occured",
48 
49  /* 0x06 - 0x09 */
50  /* SNMPv2 Errors */
51  "NOACCESS",
52  "WRONGTYPE",
53  "WRONGLENGTH",
54  "WRONGENCODING",
55 
56  /* 0x0A - 0x0F */
57  "UNDEFINED",
58  "UNDEFINED",
59  "UNDEFINED",
60  "UNDEFINED",
61  "UNDEFINED",
62  "UNDEFINED",
63 
64  /* 0x10 - 0x18 */
65  "WRONGVALUE",
66  "NOCREATION",
67  "INCONSISTENTVALUE",
68  "RESOURCEUNAVAILABLE",
69  "COMMITFAILED",
70  "UNDOFAILED",
71  "AUTHORIZATIONERROR",
72  "NOTWRITABLE",
73  "INCONSISTENTNAME",
74 
75 };
76 
77 const char *
78 snmp_errstring(int errstat)
79 {
80  if ((errstat <= (SNMP_ERR_INCONSISTENTNAME)) &&
81  (errstat >= (SNMP_ERR_NOERROR))) {
82  return error_string[errstat];
83  } else {
84  return "Unknown Error";
85  }
86 }
87 
#define SNMP_ERR_INCONSISTENTNAME
Definition: snmp_error.h:61
static const char * error_string[25]
Definition: snmp_error.c:40
#define SNMP_ERR_NOERROR
Definition: snmp_error.h:42
const char * snmp_errstring(int errstat)
Definition: snmp_error.c:78

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors