1 |
27 |
unneback |
//==========================================================================
|
2 |
|
|
//
|
3 |
|
|
// ./lib/current/include/default_store.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 Red Hat, 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 version.
|
15 |
|
|
//
|
16 |
|
|
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
|
17 |
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
18 |
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
19 |
|
|
// for more details.
|
20 |
|
|
//
|
21 |
|
|
// You should have received a copy of the GNU General Public License along
|
22 |
|
|
// with eCos; if not, write to the Free Software Foundation, Inc.,
|
23 |
|
|
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
24 |
|
|
//
|
25 |
|
|
// As a special exception, if other files instantiate templates or use macros
|
26 |
|
|
// or inline functions from this file, or you compile this file and link it
|
27 |
|
|
// with other works to produce a work based on this file, this file does not
|
28 |
|
|
// by itself cause the resulting work to be covered by the GNU General Public
|
29 |
|
|
// License. However the source code for this file must still be made available
|
30 |
|
|
// in accordance with section (3) of the GNU General Public License.
|
31 |
|
|
//
|
32 |
|
|
// This exception does not invalidate any other reasons why a work based on
|
33 |
|
|
// this file might be covered by the GNU General Public License.
|
34 |
|
|
//
|
35 |
|
|
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
|
36 |
|
|
// at http://sources.redhat.com/ecos/ecos-license/
|
37 |
|
|
// -------------------------------------------
|
38 |
|
|
//####ECOSGPLCOPYRIGHTEND####
|
39 |
|
|
//####UCDSNMPCOPYRIGHTBEGIN####
|
40 |
|
|
//
|
41 |
|
|
// -------------------------------------------
|
42 |
|
|
//
|
43 |
|
|
// Portions of this software may have been derived from the UCD-SNMP
|
44 |
|
|
// project, <http://ucd-snmp.ucdavis.edu/> from the University of
|
45 |
|
|
// California at Davis, which was originally based on the Carnegie Mellon
|
46 |
|
|
// University SNMP implementation. Portions of this software are therefore
|
47 |
|
|
// covered by the appropriate copyright disclaimers included herein.
|
48 |
|
|
//
|
49 |
|
|
// The release used was version 4.1.2 of May 2000. "ucd-snmp-4.1.2"
|
50 |
|
|
// -------------------------------------------
|
51 |
|
|
//
|
52 |
|
|
//####UCDSNMPCOPYRIGHTEND####
|
53 |
|
|
//==========================================================================
|
54 |
|
|
//#####DESCRIPTIONBEGIN####
|
55 |
|
|
//
|
56 |
|
|
// Author(s): hmt
|
57 |
|
|
// Contributors: hmt
|
58 |
|
|
// Date: 2000-05-30
|
59 |
|
|
// Purpose: Port of UCD-SNMP distribution to eCos.
|
60 |
|
|
// Description:
|
61 |
|
|
//
|
62 |
|
|
//
|
63 |
|
|
//####DESCRIPTIONEND####
|
64 |
|
|
//
|
65 |
|
|
//==========================================================================
|
66 |
|
|
/********************************************************************
|
67 |
|
|
Copyright 1989, 1991, 1992 by Carnegie Mellon University
|
68 |
|
|
|
69 |
|
|
Derivative Work -
|
70 |
|
|
Copyright 1996, 1998, 1999, 2000 The Regents of the University of California
|
71 |
|
|
|
72 |
|
|
All Rights Reserved
|
73 |
|
|
|
74 |
|
|
Permission to use, copy, modify and distribute this software and its
|
75 |
|
|
documentation for any purpose and without fee is hereby granted,
|
76 |
|
|
provided that the above copyright notice appears in all copies and
|
77 |
|
|
that both that copyright notice and this permission notice appear in
|
78 |
|
|
supporting documentation, and that the name of CMU and The Regents of
|
79 |
|
|
the University of California not be used in advertising or publicity
|
80 |
|
|
pertaining to distribution of the software without specific written
|
81 |
|
|
permission.
|
82 |
|
|
|
83 |
|
|
CMU AND THE REGENTS OF THE UNIVERSITY OF CALIFORNIA DISCLAIM ALL
|
84 |
|
|
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
|
85 |
|
|
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL CMU OR
|
86 |
|
|
THE REGENTS OF THE UNIVERSITY OF CALIFORNIA BE LIABLE FOR ANY SPECIAL,
|
87 |
|
|
INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
|
88 |
|
|
FROM THE LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
|
89 |
|
|
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
90 |
|
|
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
91 |
|
|
*********************************************************************/
|
92 |
|
|
/* default_store.h: storage space for defaults */
|
93 |
|
|
#ifndef DEFAULT_STORE_H
|
94 |
|
|
#define DEFAULT_STORE_H
|
95 |
|
|
|
96 |
|
|
#ifdef __cplusplus
|
97 |
|
|
extern "C" {
|
98 |
|
|
#endif
|
99 |
|
|
|
100 |
|
|
#define DS_MAX_IDS 3
|
101 |
|
|
#define DS_MAX_SUBIDS 32 /* needs to be a multiple of 8 */
|
102 |
|
|
|
103 |
|
|
/* begin storage definitions */
|
104 |
|
|
/* These definitions correspond with the "storid" argument to the API */
|
105 |
|
|
#define DS_LIBRARY_ID 0
|
106 |
|
|
#define DS_APPLICATION_ID 1
|
107 |
|
|
#define DS_TOKEN_ID 2
|
108 |
|
|
|
109 |
|
|
/* These definitions correspond with the "which" argument to the API,
|
110 |
|
|
when the storeid argument is DS_LIBRARY_ID */
|
111 |
|
|
/* library booleans */
|
112 |
|
|
#define DS_LIB_MIB_ERRORS 0
|
113 |
|
|
#define DS_LIB_SAVE_MIB_DESCRS 1
|
114 |
|
|
#define DS_LIB_MIB_COMMENT_TERM 2
|
115 |
|
|
#define DS_LIB_MIB_PARSE_LABEL 3
|
116 |
|
|
#define DS_LIB_DUMP_PACKET 4
|
117 |
|
|
#define DS_LIB_LOG_TIMESTAMP 5
|
118 |
|
|
#define DS_LIB_DONT_READ_CONFIGS 6
|
119 |
|
|
#define DS_LIB_MIB_REPLACE 7 /* replace objects from latest module */
|
120 |
|
|
#define DS_LIB_PRINT_NUMERIC_ENUM 8 /* print only numeric enum values */
|
121 |
|
|
#define DS_LIB_PRINT_NUMERIC_OIDS 9 /* print only numeric enum values */
|
122 |
|
|
#define DS_LIB_DONT_BREAKDOWN_OIDS 10 /* dont print oid indexes specially */
|
123 |
|
|
#define DS_LIB_ALARM_DONT_USE_SIG 11 /* don't use the alarm() signal */
|
124 |
|
|
#define DS_LIB_PRINT_FULL_OID 12 /* print fully qualified oids */
|
125 |
|
|
#define DS_LIB_QUICK_PRINT 13 /* print very brief output for parsing */
|
126 |
|
|
#define DS_LIB_RANDOM_ACCESS 14 /* random access to oid labels */
|
127 |
|
|
#define DS_LIB_REGEX_ACCESS 15 /* regex matching to oid labels */
|
128 |
|
|
#define DS_LIB_DONT_CHECK_RANGE 16 /* don't check values for ranges on send*/
|
129 |
|
|
#define DS_LIB_NO_TOKEN_WARNINGS 17 /* no warn about unknown config tokens */
|
130 |
|
|
|
131 |
|
|
/* library integers */
|
132 |
|
|
#define DS_LIB_MIB_WARNINGS 0
|
133 |
|
|
#define DS_LIB_SECLEVEL 1
|
134 |
|
|
#define DS_LIB_SNMPVERSION 2
|
135 |
|
|
#define DS_LIB_DEFAULT_PORT 3
|
136 |
|
|
#define DS_LIB_PRINT_SUFFIX_ONLY 4 /* print out only a single oid node == 1.
|
137 |
|
|
like #1 but supply mib module too == 2. */
|
138 |
|
|
|
139 |
|
|
/* library strings */
|
140 |
|
|
#define DS_LIB_SECNAME 0
|
141 |
|
|
#define DS_LIB_CONTEXT 1
|
142 |
|
|
#define DS_LIB_PASSPHRASE 2
|
143 |
|
|
#define DS_LIB_AUTHPASSPHRASE 3
|
144 |
|
|
#define DS_LIB_PRIVPASSPHRASE 4
|
145 |
|
|
#define DS_LIB_OPTIONALCONFIG 5
|
146 |
|
|
#define DS_LIB_APPTYPE 6
|
147 |
|
|
#define DS_LIB_COMMUNITY 7
|
148 |
|
|
|
149 |
|
|
/* end storage definitions */
|
150 |
|
|
|
151 |
|
|
struct ds_read_config {
|
152 |
|
|
u_char type;
|
153 |
|
|
char *token;
|
154 |
|
|
int storeid;
|
155 |
|
|
int which;
|
156 |
|
|
struct ds_read_config *next;
|
157 |
|
|
};
|
158 |
|
|
|
159 |
|
|
int ds_set_boolean(int storeid, int which, int value);
|
160 |
|
|
int ds_get_boolean(int storeid, int which);
|
161 |
|
|
int ds_toggle_boolean(int storeid, int which);
|
162 |
|
|
int ds_set_int(int storeid, int which, int value);
|
163 |
|
|
int ds_get_int(int storeid, int which);
|
164 |
|
|
int ds_set_string(int storeid, int which, const char *value);
|
165 |
|
|
char *ds_get_string(int storeid, int which);
|
166 |
|
|
int ds_register_config(u_char type, const char *ftype, const char *token,
|
167 |
|
|
int storeid, int which);
|
168 |
|
|
int ds_register_premib(u_char type, const char *ftype, const char *token,
|
169 |
|
|
int storeid, int which);
|
170 |
|
|
|
171 |
|
|
#ifdef __cplusplus
|
172 |
|
|
}
|
173 |
|
|
#endif
|
174 |
|
|
|
175 |
|
|
#endif /* DEFAULT_STORE_H */
|