]>
git.ipfire.org Git - thirdparty/squid.git/blob - include/snmp_impl.h
2 * Definitions for SNMP (RFC 1067) implementation.
6 /***********************************************************
7 Copyright 1988, 1989 by Carnegie Mellon University
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.
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
26 ******************************************************************/
33 #if (defined(__STDC__) && ! defined(NO_PROTOTYPE)) || defined(USE_PROTOTYPE)
34 #define _ANSI_ARGS_(x) x
36 #define _ANSI_ARGS_(x) ()
40 #if (defined vax) || (defined (mips))
42 * This is a fairly bogus thing to do, but there seems to be no better way for
43 * compilers that don't understand void pointers.
52 * These must not clash with SNMP error codes (all positive).
54 #define PARSE_ERROR -1
55 #define BUILD_ERROR -2
57 #define SID_MAX_LEN 200
58 #define MAX_NAME_LEN 64 /* number of subid's in a objid */
80 #define RONLY 0xAAAA /* read access for everyone */
81 #define RWRITE 0xAABA /* add write access for community private */
82 #define NOACCESS 0x0000 /* no access for anybody */
84 #define INTEGER ASN_INTEGER
85 #define STRING ASN_OCTET_STR
86 #define OBJID ASN_OBJECT_ID
87 #define NULLOBJ ASN_NULL
89 /* defined types (from the SMI, RFC 1065) */
90 #define IPADDRESS (ASN_APPLICATION | 0)
91 #define COUNTER (ASN_APPLICATION | 1)
92 #define GAUGE (ASN_APPLICATION | 2)
93 #define TIMETICKS (ASN_APPLICATION | 3)
94 #define OPAQUE (ASN_APPLICATION | 4)
96 #define NSAP (ASN_APPLICATION | 5)
97 #define COUNTER64 (ASN_APPLICATION | 6)
98 #define UINTEGER (ASN_APPLICATION | 7)
101 #define ERROR(string) fprintf(stderr,"%s(%d): ERROR %s\n",__FILE__, __LINE__, string);
103 #define ERROR(string)
107 extern u_char sid
[]; /* size SID_MAX_LEN */
109 extern u_char
*snmp_parse_var_op
_ANSI_ARGS_((u_char
* data
,
112 u_char
* var_val_type
,
117 extern u_char
*snmp_build_var_op
_ANSI_ARGS_((u_char
* data
,
125 extern u_char
*snmp_auth_parse
_ANSI_ARGS_((u_char
* data
,
131 extern u_char
*snmp_auth_build
_ANSI_ARGS_((u_char
* data
,
133 struct snmp_session
* session
,