OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [net/] [snmp/] [lib/] [current/] [include/] [snmp_impl.h] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
//==========================================================================
2
//
3
//      ./lib/current/include/snmp_impl.h
4
//
5
//
6
//==========================================================================
7
// ####ECOSGPLCOPYRIGHTBEGIN####                                            
8
// -------------------------------------------                              
9
// This file is part of eCos, the Embedded Configurable Operating System.   
10
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
11
//
12
// eCos is free software; you can redistribute it and/or modify it under    
13
// the terms of the GNU General Public License as published by the Free     
14
// Software Foundation; either version 2 or (at your option) any later      
15
// version.                                                                 
16
//
17
// eCos is distributed in the hope that it will be useful, but WITHOUT      
18
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or    
19
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License    
20
// for more details.                                                        
21
//
22
// You should have received a copy of the GNU General Public License        
23
// along with eCos; if not, write to the Free Software Foundation, Inc.,    
24
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.            
25
//
26
// As a special exception, if other files instantiate templates or use      
27
// macros or inline functions from this file, or you compile this file      
28
// and link it with other works to produce a work based on this file,       
29
// this file does not by itself cause the resulting work to be covered by   
30
// the GNU General Public License. However the source code for this file    
31
// must still be made available in accordance with section (3) of the GNU   
32
// General Public License v2.                                               
33
//
34
// This exception does not invalidate any other reasons why a work based    
35
// on this file might be covered by the GNU General Public License.         
36
// -------------------------------------------                              
37
// ####ECOSGPLCOPYRIGHTEND####                                              
38
//####UCDSNMPCOPYRIGHTBEGIN####
39
//
40
// -------------------------------------------
41
//
42
// Portions of this software may have been derived from the UCD-SNMP
43
// project,  <http://ucd-snmp.ucdavis.edu/>  from the University of
44
// California at Davis, which was originally based on the Carnegie Mellon
45
// University SNMP implementation.  Portions of this software are therefore
46
// covered by the appropriate copyright disclaimers included herein.
47
//
48
// The release used was version 4.1.2 of May 2000.  "ucd-snmp-4.1.2"
49
// -------------------------------------------
50
//
51
//####UCDSNMPCOPYRIGHTEND####
52
//==========================================================================
53
//#####DESCRIPTIONBEGIN####
54
//
55
// Author(s):    hmt
56
// Contributors: hmt
57
// Date:         2000-05-30
58
// Purpose:      Port of UCD-SNMP distribution to eCos.
59
// Description:  
60
//              
61
//
62
//####DESCRIPTIONEND####
63
//
64
//==========================================================================
65
/********************************************************************
66
       Copyright 1989, 1991, 1992 by Carnegie Mellon University
67
 
68
                          Derivative Work -
69
Copyright 1996, 1998, 1999, 2000 The Regents of the University of California
70
 
71
                         All Rights Reserved
72
 
73
Permission to use, copy, modify and distribute this software and its
74
documentation for any purpose and without fee is hereby granted,
75
provided that the above copyright notice appears in all copies and
76
that both that copyright notice and this permission notice appear in
77
supporting documentation, and that the name of CMU and The Regents of
78
the University of California not be used in advertising or publicity
79
pertaining to distribution of the software without specific written
80
permission.
81
 
82
CMU AND THE REGENTS OF THE UNIVERSITY OF CALIFORNIA DISCLAIM ALL
83
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
84
WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL CMU OR
85
THE REGENTS OF THE UNIVERSITY OF CALIFORNIA BE LIABLE FOR ANY SPECIAL,
86
INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
87
FROM THE LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
88
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
89
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
90
*********************************************************************/
91
#ifndef SNMP_IMPL_H
92
#define SNMP_IMPL_H
93
 
94
#ifdef __cplusplus
95
extern "C" {
96
#endif
97
/*
98
* file: snmp_impl.h
99
*/
100
 
101
/*
102
 * Definitions for SNMP implementation.
103
 *
104
 *
105
 */
106
/***********************************************************
107
        Copyright 1988, 1989 by Carnegie Mellon University
108
 
109
                      All Rights Reserved
110
 
111
Permission to use, copy, modify, and distribute this software and its
112
documentation for any purpose and without fee is hereby granted,
113
provided that the above copyright notice appear in all copies and that
114
both that copyright notice and this permission notice appear in
115
supporting documentation, and that the name of CMU not be
116
used in advertising or publicity pertaining to distribution of the
117
software without specific, written prior permission.
118
 
119
CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
120
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
121
CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
122
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
123
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
124
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
125
SOFTWARE.
126
******************************************************************/
127
 
128
#include<stdio.h>
129
 
130
#define COMMUNITY_MAX_LEN       256
131
 
132
/* Space for character representation of an object identifier */
133
#define SPRINT_MAX_LEN          2560
134
 
135
 
136
#ifndef NULL
137
#define NULL 0
138
#endif
139
 
140
#ifndef TRUE
141
#define TRUE    1
142
#endif
143
#ifndef FALSE
144
#define FALSE   0
145
#endif
146
 
147
#define READ        1
148
#define WRITE       0
149
 
150
#define RESERVE1    0
151
#define RESERVE2    1
152
#define ACTION      2
153
#define COMMIT      3
154
#define FREE        4
155
#define UNDO        5
156
#define FINISHED_SUCCESS        9
157
#define FINISHED_FAILURE        10
158
 
159
/* Access control statements for the agent */
160
#define RONLY   0x1     /* read access only */
161
#define RWRITE  0x2     /* read and write access (must have 0x2 bit set) */
162
 
163
#define NOACCESS 0x0000 /* no access for anybody */
164
 
165
/* defined types (from the SMI, RFC 1157) */
166
#define ASN_IPADDRESS   (ASN_APPLICATION | 0)
167
#define ASN_COUNTER     (ASN_APPLICATION | 1)
168
#define ASN_GAUGE       (ASN_APPLICATION | 2)
169
#define ASN_UNSIGNED    (ASN_APPLICATION | 2)  /* RFC 1902 - same as GAUGE */
170
#define ASN_TIMETICKS   (ASN_APPLICATION | 3)
171
#define ASN_OPAQUE      (ASN_APPLICATION | 4)  /* changed so no conflict with other includes */
172
 
173
/* defined types (from the SMI, RFC 1442) */
174
#define ASN_NSAP        (ASN_APPLICATION | 5)  /* historic - don't use */
175
#define ASN_COUNTER64   (ASN_APPLICATION | 6)
176
#define ASN_UINTEGER    (ASN_APPLICATION | 7)  /* historic - don't use */
177
 
178
#ifdef OPAQUE_SPECIAL_TYPES
179
/* defined types from draft-perkins-opaque-01.txt */
180
#define ASN_FLOAT           (ASN_APPLICATION | 8)
181
#define ASN_DOUBLE          (ASN_APPLICATION | 9)
182
#define ASN_INTEGER64        (ASN_APPLICATION | 10)
183
#define ASN_UNSIGNED64       (ASN_APPLICATION | 11)
184
#endif /* OPAQUE_SPECIAL_TYPES */
185
 
186
/* #define CMU_COMPATIBLE */
187
#ifdef CMU_COMPATIBLE
188
#define INTEGER     ASN_INTEGER
189
#define STRING      ASN_OCTET_STR
190
#define OBJID       ASN_OBJECT_ID
191
#define NULLOBJ     ASN_NULL
192
#define BITSTRING   ASN_BIT_STR  /* HISTORIC - don't use */
193
#define IPADDRESS   ASN_IPADDRESS
194
#define COUNTER     ASN_COUNTER
195
#define GAUGE       ASN_GAUGE
196
#define UNSIGNED    ASN_UNSIGNED
197
#define TIMETICKS   ASN_TIMETICKS
198
#define ASNT_OPAQUE ASN_OPAQUE
199
#define NSAP        ASN_NSAP
200
#define COUNTER64   ASN_COUNTER64
201
#define UINTEGER    ASN_UINTEGER
202
#endif /* CMU_COMPATIBLE */
203
 
204
/* changed to ERROR_MSG to eliminate conflict with other includes */
205
#define ERROR_MSG(string)       snmp_set_detail(string)
206
 
207
/* from snmp.c */
208
extern u_char   sid[];  /* size SID_MAX_LEN */
209
extern int snmp_errno;
210
 
211
 
212
/*
213
 * For calling secauth_build, FIRST_PASS is an indication that a new nonce
214
 * and lastTimeStamp should be recorded.  LAST_PASS is an indication that
215
 * the packet should be checksummed and encrypted if applicable, in
216
 * preparation for transmission.
217
 * 0 means do neither, FIRST_PASS | LAST_PASS means do both.
218
 * For secauth_parse, FIRST_PASS means decrypt the packet, otherwise leave it
219
 * alone.  LAST_PASS is ignored.
220
 */
221
#define FIRST_PASS      1
222
#define LAST_PASS       2
223
u_char  *snmp_comstr_parse(u_char *, size_t *, u_char *, size_t *, long *);
224
u_char  *snmp_comstr_build (u_char *, size_t *, u_char *, size_t *, long *, size_t);
225
 
226
int has_access (u_char, int, int, int);
227
#ifdef __cplusplus
228
}
229
#endif
230
 
231
#endif /* SNMP_IMPL_H */

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.