net-snmp
5.4.1
|
00001 #ifndef SNMP_IMPL_H 00002 #define SNMP_IMPL_H 00003 00004 #ifdef __cplusplus 00005 extern "C" { 00006 #endif 00007 /* 00008 * * file: snmp_impl.h 00009 */ 00010 00011 /* 00012 * Definitions for SNMP implementation. 00013 * 00014 * 00015 */ 00016 /*********************************************************** 00017 Copyright 1988, 1989 by Carnegie Mellon University 00018 00019 All Rights Reserved 00020 00021 Permission to use, copy, modify, and distribute this software and its 00022 documentation for any purpose and without fee is hereby granted, 00023 provided that the above copyright notice appear in all copies and that 00024 both that copyright notice and this permission notice appear in 00025 supporting documentation, and that the name of CMU not be 00026 used in advertising or publicity pertaining to distribution of the 00027 software without specific, written prior permission. 00028 00029 CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 00030 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 00031 CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 00032 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 00033 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 00034 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 00035 SOFTWARE. 00036 ******************************************************************/ 00037 00038 #include<stdio.h> 00039 #include<net-snmp/types.h> /* for 'u_char', etc */ 00040 00041 #define COMMUNITY_MAX_LEN 256 00042 00043 /* 00044 * Space for character representation of an object identifier 00045 */ 00046 #define SPRINT_MAX_LEN 2560 00047 00048 00049 #ifndef NULL 00050 #define NULL 0 00051 #endif 00052 00053 #ifndef TRUE 00054 #define TRUE 1 00055 #endif 00056 #ifndef FALSE 00057 #define FALSE 0 00058 #endif 00059 00060 #define READ 1 00061 #define WRITE 0 00062 00063 #define RESERVE1 0 00064 #define RESERVE2 1 00065 #define ACTION 2 00066 #define COMMIT 3 00067 #define FREE 4 00068 #define UNDO 5 00069 #define FINISHED_SUCCESS 9 00070 #define FINISHED_FAILURE 10 00071 00072 /* 00073 * Access control statements for the agent 00074 */ 00075 #define RONLY 0x1 /* read access only */ 00076 #define RWRITE 0x2 /* read and write access (must have 0x2 bit set) */ 00077 00078 #define NOACCESS 0x0000 /* no access for anybody */ 00079 00080 /* 00081 * defined types (from the SMI, RFC 1157) 00082 */ 00083 #define ASN_IPADDRESS (ASN_APPLICATION | 0) 00084 #define ASN_COUNTER (ASN_APPLICATION | 1) 00085 #define ASN_GAUGE (ASN_APPLICATION | 2) 00086 #define ASN_UNSIGNED (ASN_APPLICATION | 2) /* RFC 1902 - same as GAUGE */ 00087 #define ASN_TIMETICKS (ASN_APPLICATION | 3) 00088 #define ASN_OPAQUE (ASN_APPLICATION | 4) /* changed so no conflict with other includes */ 00089 00090 /* 00091 * defined types (from the SMI, RFC 1442) 00092 */ 00093 #define ASN_NSAP (ASN_APPLICATION | 5) /* historic - don't use */ 00094 #define ASN_COUNTER64 (ASN_APPLICATION | 6) 00095 #define ASN_UINTEGER (ASN_APPLICATION | 7) /* historic - don't use */ 00096 00097 #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES 00098 /* 00099 * defined types from draft-perkins-opaque-01.txt 00100 */ 00101 #define ASN_FLOAT (ASN_APPLICATION | 8) 00102 #define ASN_DOUBLE (ASN_APPLICATION | 9) 00103 #define ASN_INTEGER64 (ASN_APPLICATION | 10) 00104 #define ASN_UNSIGNED64 (ASN_APPLICATION | 11) 00105 #endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */ 00106 00107 /* 00108 * changed to ERROR_MSG to eliminate conflict with other includes 00109 */ 00110 #ifndef ERROR_MSG 00111 #define ERROR_MSG(string) snmp_set_detail(string) 00112 #endif 00113 00114 /* 00115 * from snmp.c 00116 */ 00117 extern u_char sid[]; /* size SID_MAX_LEN */ 00118 NETSNMP_IMPORT int snmp_errno; 00119 00120 00121 /* 00122 * For calling secauth_build, FIRST_PASS is an indication that a new nonce 00123 * and lastTimeStamp should be recorded. LAST_PASS is an indication that 00124 * the packet should be checksummed and encrypted if applicable, in 00125 * preparation for transmission. 00126 * 0 means do neither, FIRST_PASS | LAST_PASS means do both. 00127 * For secauth_parse, FIRST_PASS means decrypt the packet, otherwise leave it 00128 * alone. LAST_PASS is ignored. 00129 */ 00130 #define FIRST_PASS 1 00131 #define LAST_PASS 2 00132 u_char *snmp_comstr_parse(u_char *, size_t *, u_char *, 00133 size_t *, long *); 00134 u_char *snmp_comstr_build(u_char *, size_t *, u_char *, 00135 size_t *, long *, size_t); 00136 00137 int has_access(u_char, int, int, int); 00138 #ifdef __cplusplus 00139 } 00140 #endif 00141 #endif /* SNMP_IMPL_H */