storage space for defaults
[The Net-SNMP library]

The purpose of the default storage is three-fold: [詳細]

データ構造

struct  netsnmp_ds_read_config_s

型定義

typedef netsnmp_ds_read_config_s netsnmp_ds_read_config

関数

void netsnmp_ds_handle_config (const char *token, char *line)
int netsnmp_ds_set_boolean (int storeid, int which, int value)
 Stores "true" or "false" given an int value for value into netsnmp_ds_booleans[store][which] slot.
int netsnmp_ds_toggle_boolean (int storeid, int which)
int netsnmp_ds_get_boolean (int storeid, int which)
int netsnmp_ds_set_int (int storeid, int which, int value)
int netsnmp_ds_get_int (int storeid, int which)
int netsnmp_ds_set_string (int storeid, int which, const char *value)
char * netsnmp_ds_get_string (int storeid, int which)
int netsnmp_ds_set_void (int storeid, int which, void *value)
void * netsnmp_ds_get_void (int storeid, int which)
int netsnmp_ds_parse_boolean (char *line)
int netsnmp_ds_register_config (u_char type, const char *ftype, const char *token, int storeid, int which)
int netsnmp_ds_register_premib (u_char type, const char *ftype, const char *token, int storeid, int which)
void netsnmp_ds_shutdown ()

説明

The purpose of the default storage is three-fold:

1) To create a global storage space without creating a whole bunch of globally accessible variables or a whole bunch of access functions to work with more privately restricted variables.

2) To provide a single location where the thread lock- ing needs to be implemented. At the time of this writing, however, thread locking is not yet in place.

3) To reduce the number of cross dependencies between code pieces that may or may not be linked together in the long run. This provides for a single loca- tion in which configuration data, for example, can be stored for a separate section of code that may not be linked in to the application in question.

The functions defined here implement these goals.

Currently, three data types are supported: booleans, inte- gers, and strings. Each of these data types have separate storage spaces. In addition, the storage space for each data type is divided further by the application level. Currently, there are two storage spaces. The first is reserved for the SNMP library itself. The second is intended for use in applications and is not modified or checked by the library, and, therefore, this is the space usable by you.

These definitions correspond with the "storid" argument to the API

These definitions correspond with the "which" argument to the API, when the storeid argument is NETSNMP_DS_LIBRARY_ID

library booleans

library integers

library strings


関数

int netsnmp_ds_set_boolean ( int  storeid,
int  which,
int  value 
)

Stores "true" or "false" given an int value for value into netsnmp_ds_booleans[store][which] slot.

引数:
storeid an index to the boolean storage container's first index(store)
which an index to the boolean storage container's second index(which)
value if > 0, "true" is set into the slot otherwise "false"
戻り値:
Returns SNMPPERR_GENERR if the storeid and which parameters do not correspond to a valid slot, or SNMPERR_SUCCESS otherwise.

default_store.c197 行で定義されています。

参照元 init_agent()netsnmp_ds_handle_config()read_configs()read_premib_configs()setup_tree()snmp_out_toggle_options().


net-snmpに対してSat Sep 5 13:14:29 2009に生成されました。  doxygen 1.4.7