1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
|
.\"
.\" Japanese Version Copyright (c) 2001 Yuichi SATO
.\" all rights reserved.
.\" Translated Mon Aug 20 07:04:42 JST 2001
.\" by Yuichi SATO <ysato@h4.dion.ne.jp>
.\"
.TH SNMP_AGENT_API 3 "27 Oct 1999"
.UC 5
.SH ̾
default_store \- ǡΰŪʳǼ
.SH
.nf
#include <ucd-snmp/ucd-snmp-config.h>
#include <ucd-snmp/ucd-snmp-includes.h>
int ds_set_boolean(int storeid, int which, int value);
int ds_get_boolean(int storeid, int which);
int ds_set_int(int storeid, int which, int value);
int ds_get_int(int storeid, int which);
int ds_set_string(int storeid, int which, const char *value);
char *ds_get_string(int storeid, int which);
int ds_register_config(u_char type, const char *ftype, const char *token,
int storeid, int which);
int ds_register_premib(u_char type, const char *ftype, const char *token,
int storeid, int which);
void ds_shutdown(void);
.fi
.SH
ǥեȤΥǡǼŪϡ 3 ĤǤ:
.IP 1)
Ū˥Ǥѿ
äȸ¤줿ѿ˥ؿꤻˡ
ŪʥǡǼ롣
.IP 2)
å (thread) åɬפǼ롣
ƤǤϡåɥåϤޤƤʤ
.IP 3)
ɴ֤߰¸ο餹
(ɤϺǽŪ˥Ƥ⤷ʤƤɤ)
ȤƤ륢ץꥱǥʤ
̡ΥΥɤǻȤǡΤ褦
ǡγǼ롣
.PP
ؿϡʲŪ (¸뵡ǽ) Ƥ롣
.PP
ߤΤȤ (boolean) (integer)
ʸ (string) Ȥ 3 ĤΥǡݡȤƤ롣
ƥǡΥǡϡ̡γǼʬƤ롣
ˡƥǡγǼϥץꥱ٥Ǥʬ䤵Ƥ롣
ߤΤȤ 2 ĤγǼ꤬롣
1 ܤγǼϡSNMP 饤֥꼫ȤˤäͽƤ롣
2 ܤγǼϡץꥱˤäƻȤ뤳ȤտޤƤꡢ
饤֥ˤѹåԤʤΤǡ
桼Ȥ䤹ΤˤʤäƤ롣
.PP
3 ĤγǼϡ
bool_storage[storeid][which], int_storage[storeid][which],
string_storage[storeid][which]
Ȥ 3 Ĥȹͤ뤳ȤǤ롣
ǡϰʲؿǥǤ롣
Ǽǡϡ
DS_APPLICATION_ID Ȥ storeid Ȥɤ
.PP
饤֥꤬ȤǼϡdefault_store.h Ƥꡢ
ߤΤȤʲΤ褦Ƥ롣
.PP
.nf
/* ʲ API "storeid" ȤƻȤ롣 */
#define DS_LIBRARY_ID 0
#define DS_APPLICATION_ID 1
#define DS_TOKEN_ID 2
/* storeid DS_LIBRARY_ID ξ硢
ʲ API "which" ȤƻȤ롣*/
/* ͤ饤֥ǻȤ */
#define DS_LIB_MIB_ERRORS 0
#define DS_LIB_SAVE_MIB_DESCRS 1
#define DS_LIB_MIB_COMMENT_TERM 2
#define DS_LIB_MIB_PARSE_LABEL 3
#define DS_LIB_DUMP_PACKET 4
#define DS_LIB_LOG_TIMESTAMP 5
#define DS_LIB_DONT_READ_CONFIGS 6
#define DS_LIB_MIB_REPLACE 7 /* ֥ȤǿΥ⥸塼֤ */
#define DS_LIB_PRINT_NUMERIC_ENUM 8 /* ͤ (enum) ͤΤߤɽ */
#define DS_LIB_PRINT_NUMERIC_OIDS 9 /* ͤ oid Τߤɽ */
#define DS_LIB_DONT_BREAKDOWN_OIDS 10 /* oid ǥåäɽʤ */
#define DS_LIB_ALARM_DONT_USE_SIG 11 /* alarm() ʥȤʤ */
#define DS_LIB_PRINT_FULL_OID 12 /* oid ɽ */
#define DS_LIB_QUICK_PRINT 13 /* ѡκݤ˴ñʽϤ */
#define DS_LIB_RANDOM_ACCESS 14 /* oid ٥˥˥ */
#define DS_LIB_REGEX_ACCESS 15 /* oid ٥ regex ˤޥåԤ */
#define DS_LIB_DONT_CHECK_RANGE 16 /* send ͤϰϤΥåԤʤ */
#define DS_LIB_NO_TOKEN_WARNINGS 17 /* config ؿ token ʾǤٹФʤ */
#define DS_LIB_NUMERIC_TIMETICKS 18 /* timeticks ͤɽ */
#define DS_LIB_ESCAPE_QUOTES 19 /* oid ΰ˥פ */
#define DS_LIB_REVERSE_ENCODE 20 /* ХåեȤؤΥѥåȤɤ */
#define DS_LIB_PRINT_BARE_VALUE 21 /* (OID = value Ǥʤ) value ɽ */
#define DS_LIB_EXTENDED_INDEX 22 /* [x1][x2] Ȥĥǥǥåɽ */
/* ͤ饤֥ǻȤ */
#define DS_LIB_MIB_WARNINGS 0
#define DS_LIB_SECLEVEL 1
#define DS_LIB_SNMPVERSION 2
#define DS_LIB_DEFAULT_PORT 3
#define DS_LIB_PRINT_SUFFIX_ONLY 4 /* oid node == 1 ΤΤɽ롣
1 ܤȻƤ뤬mib ⥸塼
too == 2 ΤΤͿ롣 */
/* ʸ饤֥ǻȤ */
#define DS_LIB_SECNAME 0
#define DS_LIB_CONTEXT 1
#define DS_LIB_PASSPHRASE 2
#define DS_LIB_AUTHPASSPHRASE 3
#define DS_LIB_PRIVPASSPHRASE 4
#define DS_LIB_OPTIONALCONFIG 5
#define DS_LIB_APPTYPE 6
#define DS_LIB_COMMUNITY 7
#define DS_LIB_PERSISTENT_DIR 8
#define DS_LIB_CONFIGURATION_DIR 9
.fi
.SH ؿ
.IP "ds_set_boolean(int storeid, int which, int value)"
.I value
!= 0
ξϡbool_storage[storeid][which] ΥåȤ
.I true
롣
ʳξ
.I false
롣
.IP "int ds_get_boolean(int storeid, int which)"
storage[storeid][which] true ξϡ1 ֤
ʳξϡ0 ֤
.IP "int ds_set_string(int storeid, int which, const char *value)"
.I value
å string_storage[storeid][which] 롣
.IP "char *ds_get_string(int storeid, int which)"
å string_storage[storeid][which] äƤʸ֤
.IP "ds_set_int(int storeid, int which, int value)"
.I value
å int_storage[storeid][which] 롣
.IP "int ds_get_int(int storeid, int which)"
å int_storage[storeid][which] äƤ֤ͤ
.IP "void ds_shutdown(void)"
ds_register_config ds_register_premib ǽ
ݻƤ˻ȤƤ롣
.IP "ds_register_config(u_char type, const char *ftype, const char *token, int storeid, int which)"
token եΥǥ쥯ƥ֤Ͽ
ǥեȤγǼפȥåȤ˴ϢŤ롣
äˡ
.I storeid
.I which
.I type
ǡγǼåȤؤ
.I type
ASN_BOOLEAN, ASN_INTEGER, ASN_OCTET_STR Τ줫 1 ĤǤ롣
.I ftype
ѿ
.I token
ɤõΥե̾Υ١ʸǤ롣
㤨С
.RS
.IP
ds_register_config(ASN_INTEGER, "snmp", "testtoken", DS_APPLICATION_ID, 5)
.RE
.IP
ȤƤӽФǤϡsnmp.conf ե뤬ĤäƥѡȤˡ
"testtoken" ȤǻϤޤԤɤޤ졢
"testtoken" θˤͤ
å int_storage[DS_APPLICATION_ID][5] ˳Ǽ롣
㤨Сե
.RS
.IP
testtoken 42
.RE
.IP
ȤԤǤϡint_storage[DS_APPLICATION_ID][5] = 42 ꤵ롣
.SH Ϣ
snmp_config(5), read_config(3)
|