12 * Definitions for SNMP implementation.
16 /***********************************************************
17 Copyright 1988, 1989 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
36 ******************************************************************/
39 #include<net-snmp/types.h> /* for 'u_char', etc */
41 #define COMMUNITY_MAX_LEN 256
44 * Space for character representation of an object identifier
46 #define SPRINT_MAX_LEN 2560
69 #define FINISHED_SUCCESS 9
70 #define FINISHED_FAILURE 10
73 * Access control statements for the agent
75 #define RONLY 0x1 /* read access only */
76 #define RWRITE 0x2 /* read and write access (must have 0x2 bit set) */
78 #define NOACCESS 0x0000 /* no access for anybody */
81 * defined types (from the SMI, RFC 1157)
83 #define ASN_IPADDRESS (ASN_APPLICATION | 0)
84 #define ASN_COUNTER (ASN_APPLICATION | 1)
85 #define ASN_GAUGE (ASN_APPLICATION | 2)
86 #define ASN_UNSIGNED (ASN_APPLICATION | 2) /* RFC 1902 - same as GAUGE */
87 #define ASN_TIMETICKS (ASN_APPLICATION | 3)
88 #define ASN_OPAQUE (ASN_APPLICATION | 4) /* changed so no conflict with other includes */
91 * defined types (from the SMI, RFC 1442)
93 #define ASN_NSAP (ASN_APPLICATION | 5) /* historic - don't use */
94 #define ASN_COUNTER64 (ASN_APPLICATION | 6)
95 #define ASN_UINTEGER (ASN_APPLICATION | 7) /* historic - don't use */
97 #ifdef OPAQUE_SPECIAL_TYPES
99 * defined types from draft-perkins-opaque-01.txt
101 #define ASN_FLOAT (ASN_APPLICATION | 8)
102 #define ASN_DOUBLE (ASN_APPLICATION | 9)
103 #define ASN_INTEGER64 (ASN_APPLICATION | 10)
104 #define ASN_UNSIGNED64 (ASN_APPLICATION | 11)
105 #endif /* OPAQUE_SPECIAL_TYPES */
108 * changed to ERROR_MSG to eliminate conflict with other includes
111 #define ERROR_MSG(string) snmp_set_detail(string)
117 extern u_char sid[]; /* size SID_MAX_LEN */
118 extern int snmp_errno;
122 * For calling secauth_build, FIRST_PASS is an indication that a new nonce
123 * and lastTimeStamp should be recorded. LAST_PASS is an indication that
124 * the packet should be checksummed and encrypted if applicable, in
125 * preparation for transmission.
126 * 0 means do neither, FIRST_PASS | LAST_PASS means do both.
127 * For secauth_parse, FIRST_PASS means decrypt the packet, otherwise leave it
128 * alone. LAST_PASS is ignored.
132 u_char *snmp_comstr_parse(u_char *, size_t *, u_char *,
134 u_char *snmp_comstr_build(u_char *, size_t *, u_char *,
135 size_t *, long *, size_t);
137 int has_access(u_char, int, int, int);
141 #endif /* SNMP_IMPL_H */