mib parsing and datatype manipulation routines.
[The Net-SNMP library]


データ構造

struct  _PrefixList
struct  parse_hints

型定義

typedef _PrefixListPrefixListPtr
typedef _PrefixList PrefixList

列挙型

enum  inet_address_type {
  IPV4 = 1, IPV6 = 2, IPV4Z = 3, IPV6Z = 4,
  DNS = 16
}

関数

int _sprint_hexstring_line (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const u_char *cp, size_t line_len)
 Prints a hexadecimal string into a buffer.
int sprint_realloc_hexstring (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const u_char *cp, size_t len)
int sprint_realloc_asciistring (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const u_char *cp, size_t len)
 Prints an ascii string into a buffer.
int sprint_realloc_octet_string (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
 Prints an octet string into a buffer.
int sprint_realloc_counter64 (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
 Prints a counter into a buffer.
int sprint_realloc_opaque (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
 Prints an object identifier into a buffer.
int sprint_realloc_object_identifier (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
 Prints an object identifier into a buffer.
int sprint_realloc_timeticks (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
 Prints a timetick variable into a buffer.
int sprint_realloc_hinted_integer (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, long val, const char decimaltype, const char *hint, const char *units)
 Prints an integer according to the hint into a buffer.
int sprint_realloc_integer (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
 Prints an integer into a buffer.
int sprint_realloc_uinteger (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
 Prints an unsigned integer into a buffer.
int sprint_realloc_gauge (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
 Prints a gauge value into a buffer.
int sprint_realloc_counter (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
 Prints a counter value into a buffer.
int sprint_realloc_networkaddress (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
 Prints a network address into a buffer.
int sprint_realloc_ipaddress (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
 Prints an ip-address into a buffer.
int sprint_realloc_null (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
 Prints a null value into a buffer.
int sprint_realloc_bitstring (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
 Prints a bit string into a buffer.
int sprint_realloc_nsapaddress (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
int sprint_realloc_badtype (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
 Fallback routine for a bad type, prints "Variable has bad type" into a buffer.
int sprint_realloc_by_type (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
 Universal print routine, prints a variable into a buffer according to the variable type.
treeget_tree_head (void)
 Retrieves the tree head.
char * snmp_out_toggle_options (char *options)
void snmp_out_toggle_options_usage (const char *lead, FILE *outf)
char * snmp_in_options (char *optarg, int argc, char *const *argv)
char * snmp_in_toggle_options (char *options)
void snmp_in_toggle_options_usage (const char *lead, FILE *outf)
 Prints out a help usage for the in* toggle options.
void register_mib_handlers (void)
void netsnmp_set_mib_directory (const char *dir)
char * netsnmp_get_mib_directory (void)
void netsnmp_fixup_mib_directory (void)
void init_mib (void)
 Initialises the mib reader.
void shutdown_mib (void)
 Unloads all mibs.
void print_mib (FILE *fp)
 Prints the MIBs to the file fp.
void print_ascii_dump (FILE *fp)
void set_function (struct tree *subtree)
 Set's the printing function printomat in a subtree according it's type
int read_objid (const char *input, oid *output, size_t *out_len)
 Reads an object identifier from an input string into internal OID form.
void netsnmp_sprint_realloc_objid (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, int *buf_overflow, const oid *objid, size_t objidlen)
treenetsnmp_sprint_realloc_objid_tree (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, int *buf_overflow, const oid *objid, size_t objidlen)
int sprint_realloc_objid (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const oid *objid, size_t objidlen)
int snprint_objid (char *buf, size_t buf_len, const oid *objid, size_t objidlen)
void print_objid (const oid *objid, size_t objidlen)
 Prints an oid to stdout.
void fprint_objid (FILE *f, const oid *objid, size_t objidlen)
 Prints an oid to a file descriptor.
int sprint_realloc_variable (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const oid *objid, size_t objidlen, const netsnmp_variable_list *variable)
int snprint_variable (char *buf, size_t buf_len, const oid *objid, size_t objidlen, const netsnmp_variable_list *variable)
void print_variable (const oid *objid, size_t objidlen, const netsnmp_variable_list *variable)
 Prints a variable to stdout.
void fprint_variable (FILE *f, const oid *objid, size_t objidlen, const netsnmp_variable_list *variable)
 Prints a variable to a file descriptor.
int sprint_realloc_value (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const oid *objid, size_t objidlen, const netsnmp_variable_list *variable)
int snprint_value (char *buf, size_t buf_len, const oid *objid, size_t objidlen, const netsnmp_variable_list *variable)
void print_value (const oid *objid, size_t objidlen, const netsnmp_variable_list *variable)
void fprint_value (FILE *f, const oid *objid, size_t objidlen, const netsnmp_variable_list *variable)
int build_oid_segment (netsnmp_variable_list *var)
 Takes the value in VAR and turns it into an OID segment in var->name.
int build_oid_noalloc (oid *in, size_t in_len, size_t *out_len, oid *prefix, size_t prefix_len, netsnmp_variable_list *indexes)
int build_oid (oid **out, size_t *out_len, oid *prefix, size_t prefix_len, netsnmp_variable_list *indexes)
int parse_oid_indexes (oid *oidIndex, size_t oidLen, netsnmp_variable_list *data)
int parse_one_oid_index (oid **oidStart, size_t *oidLen, netsnmp_variable_list *data, int complete)
int dump_realloc_oid_to_inetaddress (const int addr_type, const oid *objid, size_t objidlen, u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, char quotechar)
int dump_realloc_oid_to_string (const oid *objid, size_t objidlen, u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, char quotechar)
treeget_tree (const oid *objid, size_t objidlen, struct tree *subtree)
void print_description (oid *objid, size_t objidlen, int width)
 Prints on oid description on stdout.
void fprint_description (FILE *f, oid *objid, size_t objidlen, int width)
 Prints on oid description into a file descriptor.
int snprint_description (char *buf, size_t buf_len, oid *objid, size_t objidlen, int width)
int sprint_realloc_description (u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, oid *objid, size_t objidlen, int width)
int get_module_node (const char *fname, const char *module, oid *objid, size_t *objidlen)
int get_wild_node (const char *name, oid *objid, size_t *objidlen)
int get_node (const char *name, oid *objid, size_t *objidlen)
void clear_tree_flags (register struct tree *tp)
void print_oid_report (FILE *fp)
void print_oid_report_enable_labeledoid (void)
void print_oid_report_enable_oid (void)
void print_oid_report_enable_suffix (void)
void print_oid_report_enable_symbolic (void)
void print_oid_report_enable_mibchildoid (void)
char * uptime_string (u_long timeticks, char *buf)
 Converts timeticks to hours, minutes, seconds string.
char * uptime_string_n (u_long timeticks, char *buf, size_t buflen)
oid * snmp_parse_oid (const char *argv, oid *root, size_t *rootlen)
 Given a string, parses an oid out of it (if possible).
const char * parse_octet_hint (const char *hint, const char *value, unsigned char **new_val, int *new_val_len)
u_char mib_to_asn_type (int mib_type)
int netsnmp_str2oid (const char *S, oid *O, int L)
 Converts a string to its OID form.
int netsnmp_oid2chars (char *C, int L, const oid *O)
 Converts an OID to its character form.
int netsnmp_oid2str (char *S, int L, oid *O)
 Converts an OID to its string form.
int snprint_by_type (char *buf, size_t buf_len, netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
int snprint_hexstring (char *buf, size_t buf_len, const u_char *cp, size_t len)
int snprint_asciistring (char *buf, size_t buf_len, const u_char *cp, size_t len)
int snprint_octet_string (char *buf, size_t buf_len, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
int snprint_opaque (char *buf, size_t buf_len, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
int snprint_object_identifier (char *buf, size_t buf_len, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
int snprint_timeticks (char *buf, size_t buf_len, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
int snprint_hinted_integer (char *buf, size_t buf_len, long val, const char *hint, const char *units)
int snprint_integer (char *buf, size_t buf_len, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
int snprint_uinteger (char *buf, size_t buf_len, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
int snprint_gauge (char *buf, size_t buf_len, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
int snprint_counter (char *buf, size_t buf_len, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
int snprint_networkaddress (char *buf, size_t buf_len, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
int snprint_ipaddress (char *buf, size_t buf_len, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
int snprint_null (char *buf, size_t buf_len, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
int snprint_bitstring (char *buf, size_t buf_len, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
int snprint_nsapaddress (char *buf, size_t buf_len, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
int snprint_counter64 (char *buf, size_t buf_len, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)
int snprint_badtype (char *buf, size_t buf_len, const netsnmp_variable_list *var, const struct enum_list *enums, const char *hint, const char *units)

変数

treetree_head
treeMib
oid RFC1213_MIB [] = { 1, 3, 6, 1, 2, 1 }
PrefixList mib_prefixes []

関数

int _sprint_hexstring_line ( u_char **  buf,
size_t *  buf_len,
size_t *  out_len,
int  allow_realloc,
const u_char *  cp,
size_t  line_len 
)

Prints a hexadecimal string into a buffer.

The characters pointed by *cp are encoded as hexadecimal string.

If allow_realloc is true the buffer will be (re)allocated to fit in the needed size. (Note: *buf may change due to this.)

引数:
buf address of the buffer to print to.
buf_len address to an integer containing the size of buf.
out_len incremented by the number of characters printed.
allow_realloc if not zero reallocate the buffer to fit the needed size.
cp the array of characters to encode.
line_len the array length of cp.
戻り値:
1 on success, or 0 on failure (out of memory, or buffer to small when not allowed to realloc.)

mib.c271 行で定義されています。

参照先 netsnmp_ds_get_boolean()snmp_realloc().

参照元 sprint_realloc_hexstring().

int build_oid ( oid **  out,
size_t *  out_len,
oid *  prefix,
size_t  prefix_len,
netsnmp_variable_list indexes 
)

mib.c3598 行で定義されています。

参照先 build_oid_noalloc()tree::indexessnmp_clone_mem().

参照元 _netsnmp_tdata_generate_index_oid()netsnmp_table_build_oid()netsnmp_table_data_generate_index_oid().

int build_oid_segment ( netsnmp_variable_list var  ) 

Takes the value in VAR and turns it into an OID segment in var->name.

引数:
var The variable.
戻り値:
SNMPERR_SUCCESS or SNMPERR_GENERR

mib.c3462 行で定義されています。

参照先 netsnmp_vardata::integervariable_list::namevariable_list::name_lengthvariable_list::name_locNULLnetsnmp_vardata::objidSNMP_FREEnetsnmp_vardata::stringvariable_list::typevariable_list::valvariable_list::val_len.

参照元 build_oid_noalloc().

void fprint_description ( FILE *  f,
oid *  objid,
size_t  objidlen,
int  width 
)

Prints on oid description into a file descriptor.

引数:
f The file descriptor to print to.
objid The object identifier.
objidlen The object id length.
width Number of subidentifiers.

mib.c4439 行で定義されています。

参照先 NULLSNMP_FREEsprint_realloc_description().

参照元 print_description().

void fprint_objid ( FILE *  f,
const oid *  objid,
size_t  objidlen 
)

Prints an oid to a file descriptor.

引数:
f The file descriptor to print to.
objid The oid to print
objidlen The length of oidid.

mib.c3190 行で定義されています。

参照先 netsnmp_sprint_realloc_objid_tree()NULLSNMP_FREE.

参照元 print_objid().

void fprint_variable ( FILE *  f,
const oid *  objid,
size_t  objidlen,
const netsnmp_variable_list variable 
)

Prints a variable to a file descriptor.

引数:
f The file descriptor to print to.
objid The object id.
objidlen The length of teh object id.
variable The variable to print.

mib.c3337 行で定義されています。

参照先 NULLSNMP_FREEsprint_realloc_variable().

参照元 print_variable().

struct tree* get_tree_head ( void   ) 

Retrieves the tree head.

戻り値:
the tree head.

mib.c2053 行で定義されています。

参照先 tree_head.

参照元 netsnmp_config_parse_table_set()snmp_add_var().

int get_wild_node ( const char *  name,
oid *  objid,
size_t *  objidlen 
)

参照:
comments on find_best_tree_node for usage after first time.

mib.c5459 行で定義されています。

参照先 get_node()tree::labelNULLtree_head.

参照元 snmp_parse_oid().

void init_mib ( void   ) 

Initialises the mib reader.

Reads in all settings from the environment.

mib.c2562 行で定義されています。

参照先 tree::child_listtree::label_PrefixList::lenMibmib_prefixesnetsnmp_fixup_mib_directory()netsnmp_get_mib_directory()netsnmp_getenv()NULLSNMP_FREE_PrefixList::strtree_head.

参照元 init_snmp().

void netsnmp_fixup_mib_directory ( void   ) 

mib.c2515 行で定義されています。

参照先 netsnmp_get_mib_directory()netsnmp_getenv()netsnmp_set_mib_directory()NULLSNMP_FREE.

参照元 init_mib().

char* netsnmp_get_mib_directory ( void   ) 

mib.c2468 行で定義されています。

参照先 netsnmp_ds_get_string()netsnmp_getenv()netsnmp_set_mib_directory()NULL.

参照元 init_mib()netsnmp_fixup_mib_directory().

int netsnmp_oid2chars ( char *  C,
int  L,
const oid *  O 
)

Converts an OID to its character form.

in example 5 . 1 . 2 . 3 . 4 . 5 = 12345

引数:
C The character buffer.
L The length of the buffer.
O The oid.
戻り値:
0 on Sucess, 1 on failure.

length

mib.c6246 行で定義されています。

参照元 netsnmp_oid2str().

int netsnmp_oid2str ( char *  S,
int  L,
oid *  O 
)

Converts an OID to its string form.

in example 5 . 'h' . 'e' . 'l' . 'l' . 'o' = "hello\0" (null terminated)

引数:
S The character string buffer.
L The length of the string buffer.
O The oid.
戻り値:
0 on Sucess, 1 on failure.

mib.c6274 行で定義されています。

参照先 netsnmp_oid2chars().

void netsnmp_set_mib_directory ( const char *  dir  ) 

mib.c2413 行で定義されています。

参照先 netsnmp_ds_get_string()netsnmp_ds_set_string()NULLSNMP_FREE.

参照元 netsnmp_fixup_mib_directory()netsnmp_get_mib_directory().

int netsnmp_str2oid ( const char *  S,
oid *  O,
int  L 
)

Converts a string to its OID form.

in example "hello" = 5 . 'h' . 'e' . 'l' . 'l' . 'o'

引数:
S The string.
O The oid.
L The length of the oid.
戻り値:
0 on Sucess, 1 on failure.

mib.c6211 行で定義されています。

void print_description ( oid *  objid,
size_t  objidlen,
int  width 
)

Prints on oid description on stdout.

参照:
fprint_description

mib.c4423 行で定義されています。

参照先 fprint_description().

void print_mib ( FILE *  fp  ) 

Prints the MIBs to the file fp.

引数:
fp The file descriptor to print to.

mib.c2768 行で定義されています。

参照先 tree_head.

void print_objid ( const oid *  objid,
size_t  objidlen 
)

Prints an oid to stdout.

引数:
objid The oid to print
objidlen The length of oidid.

mib.c3176 行で定義されています。

参照先 fprint_objid().

void print_variable ( const oid *  objid,
size_t  objidlen,
const netsnmp_variable_list variable 
)

Prints a variable to stdout.

引数:
objid The object id.
objidlen The length of teh object id.
variable The variable to print.

mib.c3321 行で定義されています。

参照先 fprint_variable().

int read_objid ( const char *  input,
oid *  output,
size_t *  out_len 
)

Reads an object identifier from an input string into internal OID form.

When called, out_len must hold the maximum length of the output array.

引数:
input the input string.
output the oid wirte.
out_len number of subid's in output.
戻り値:
1 if successful.
If an error occurs, this function returns 0 and MAY set snmp_errno. snmp_errno is NOT set if SET_SNMP_ERROR evaluates to nothing. This can make multi-threaded use a tiny bit more robust.

mib.c2866 行で定義されています。

参照先 get_node()netsnmp_ds_get_boolean()NULLSNMP_FREEtree_head.

参照元 read_config_read_objid()snmp_parse_oid().

void set_function ( struct tree subtree  ) 

Set's the printing function printomat in a subtree according it's type

引数:
subtree The subtree to set.

mib.c2789 行で定義されています。

参照先 NULL・tree::printer・tree::printomat・sprint_realloc_bitstring()sprint_realloc_by_type()sprint_realloc_counter()sprint_realloc_counter64()sprint_realloc_gauge()sprint_realloc_integer()sprint_realloc_ipaddress()sprint_realloc_networkaddress()sprint_realloc_nsapaddress()sprint_realloc_null()sprint_realloc_object_identifier()sprint_realloc_octet_string()sprint_realloc_opaque()sprint_realloc_timeticks()sprint_realloc_uinteger()tree::type.

void shutdown_mib ( void   ) 

Unloads all mibs.

mib.c2743 行で定義されています。

参照先 tree::labelMibNULLSNMP_FREEtree_head.

参照元 snmp_shutdown().

void snmp_in_toggle_options_usage ( const char *  lead,
FILE *  outf 
)

Prints out a help usage for the in* toggle options.

引数:
lead The lead to print for every line.
outf The file descriptor to write to.

mib.c2325 行で定義されています。

oid* snmp_parse_oid ( const char *  argv,
oid *  root,
size_t *  rootlen 
)

Given a string, parses an oid out of it (if possible).

It will try to parse it based on predetermined configuration if present or by every method possible otherwise. If a suffix has been registered using NETSNMP_DS_LIB_OIDSUFFIX, it will be appended to the input string before processing.

引数:
argv The OID to string parse
root An OID array where the results are stored.
rootlen The max length of the array going in and the data length coming out.
戻り値:
The root oid pointer if successful, or NULL otherwise.

mib.c5817 行で定義されています。

参照先 clear_tree_flags()get_node()get_wild_node()netsnmp_ds_get_boolean()netsnmp_ds_get_string()NULLread_objid()tree_head.

参照元 netsnmp_config_parse_table_set()snmp_add_var().

int sprint_realloc_asciistring ( u_char **  buf,
size_t *  buf_len,
size_t *  out_len,
int  allow_realloc,
const u_char *  cp,
size_t  len 
)

Prints an ascii string into a buffer.

The characters pointed by *cp are encoded as an ascii string.

If allow_realloc is true the buffer will be (re)allocated to fit in the needed size. (Note: *buf may change due to this.)

引数:
buf address of the buffer to print to.
buf_len address to an integer containing the size of buf.
out_len incremented by the number of characters printed.
allow_realloc if not zero reallocate the buffer to fit the needed size.
cp the array of characters to encode.
len the array length of cp.
戻り値:
1 on success, or 0 on failure (out of memory, or buffer to small when not allowed to realloc.)

mib.c367 行で定義されています。

参照先 snmp_realloc().

参照元 asn_build_string()asn_parse_string()snprint_asciistring()sprint_realloc_octet_string().

int sprint_realloc_badtype ( u_char **  buf,
size_t *  buf_len,
size_t *  out_len,
int  allow_realloc,
const netsnmp_variable_list var,
const struct enum_list enums,
const char *  hint,
const char *  units 
)

Fallback routine for a bad type, prints "Variable has bad type" into a buffer.

If allow_realloc is true the buffer will be (re)allocated to fit in the needed size. (Note: *buf may change due to this.)

引数:
buf Address of the buffer to print to.
buf_len Address to an integer containing the size of buf.
out_len Incremented by the number of characters printed.
allow_realloc if not zero reallocate the buffer to fit the needed size.
var The variable to encode.
enums The enumeration ff this variable is enumerated. may be NULL.
hint Contents of the DISPLAY-HINT clause of the MIB. See RFC 1903 Section 3.1 for details. may be NULL.
units Contents of the UNITS clause of the MIB. may be NULL.
戻り値:
1 on success, or 0 on failure (out of memory, or buffer to small when not allowed to realloc.)

mib.c1938 行で定義されています。

参照先 snmp_strcat().

参照元 snprint_badtype()sprint_realloc_by_type().

int sprint_realloc_bitstring ( u_char **  buf,
size_t *  buf_len,
size_t *  out_len,
int  allow_realloc,
const netsnmp_variable_list var,
const struct enum_list enums,
const char *  hint,
const char *  units 
)

Prints a bit string into a buffer.

If allow_realloc is true the buffer will be (re)allocated to fit in the needed size. (Note: *buf may change due to this.)

引数:
buf Address of the buffer to print to.
buf_len Address to an integer containing the size of buf.
out_len Incremented by the number of characters printed.
allow_realloc if not zero reallocate the buffer to fit the needed size.
var The variable to encode.
enums The enumeration ff this variable is enumerated. may be NULL.
hint Contents of the DISPLAY-HINT clause of the MIB. See RFC 1903 Section 3.1 for details. may be NULL.
units Contents of the UNITS clause of the MIB. may be NULL.
戻り値:
1 on success, or 0 on failure (out of memory, or buffer to small when not allowed to realloc.)

mib.c1799 行で定義されています。

参照先 netsnmp_vardata::bitstringenum_list::labelnetsnmp_ds_get_boolean()enum_list::nextNULLsnmp_strcat()sprint_realloc_by_type()sprint_realloc_hexstring()variable_list::typevariable_list::valvariable_list::val_lenenum_list::value.

参照元 set_function()snprint_bitstring()sprint_realloc_by_type().

int sprint_realloc_by_type ( u_char **  buf,
size_t *  buf_len,
size_t *  out_len,
int  allow_realloc,
const netsnmp_variable_list var,
const struct enum_list enums,
const char *  hint,
const char *  units 
)

Universal print routine, prints a variable into a buffer according to the variable type.

If allow_realloc is true the buffer will be (re)allocated to fit in the needed size. (Note: *buf may change due to this.)

引数:
buf Address of the buffer to print to.
buf_len Address to an integer containing the size of buf.
out_len Incremented by the number of characters printed.
allow_realloc if not zero reallocate the buffer to fit the needed size.
var The variable to encode.
enums The enumeration ff this variable is enumerated. may be NULL.
hint Contents of the DISPLAY-HINT clause of the MIB. See RFC 1903 Section 3.1 for details. may be NULL.
units Contents of the UNITS clause of the MIB. may be NULL.
戻り値:
1 on success, or 0 on failure (out of memory, or buffer to small when not allowed to realloc.)

mib.c1973 行で定義されています。

参照先 sprint_realloc_badtype()sprint_realloc_bitstring()sprint_realloc_counter()sprint_realloc_counter64()sprint_realloc_gauge()sprint_realloc_integer()sprint_realloc_ipaddress()sprint_realloc_null()sprint_realloc_object_identifier()sprint_realloc_octet_string()sprint_realloc_opaque()sprint_realloc_timeticks()sprint_realloc_uinteger()variable_list::type.

参照元 set_function()snprint_by_type()sprint_realloc_bitstring()sprint_realloc_counter()sprint_realloc_counter64()sprint_realloc_gauge()sprint_realloc_integer()sprint_realloc_ipaddress()sprint_realloc_networkaddress()sprint_realloc_nsapaddress()sprint_realloc_null()sprint_realloc_object_identifier()sprint_realloc_octet_string()sprint_realloc_opaque()sprint_realloc_timeticks()sprint_realloc_uinteger()sprint_realloc_value()sprint_realloc_variable()table_helper_handler().

int sprint_realloc_counter ( u_char **  buf,
size_t *  buf_len,
size_t *  out_len,
int  allow_realloc,
const netsnmp_variable_list var,
const struct enum_list enums,
const char *  hint,
const char *  units 
)

Prints a counter value into a buffer.

If allow_realloc is true the buffer will be (re)allocated to fit in the needed size. (Note: *buf may change due to this.)

引数:
buf Address of the buffer to print to.
buf_len Address to an integer containing the size of buf.
out_len Incremented by the number of characters printed.
allow_realloc if not zero reallocate the buffer to fit the needed size.
var The variable to encode.
enums The enumeration ff this variable is enumerated. may be NULL.
hint Contents of the DISPLAY-HINT clause of the MIB. See RFC 1903 Section 3.1 for details. may be NULL.
units Contents of the UNITS clause of the MIB. may be NULL.
戻り値:
1 on success, or 0 on failure (out of memory, or buffer to small when not allowed to realloc.)

mib.c1566 行で定義されています。

参照先 netsnmp_vardata::integernetsnmp_ds_get_boolean()NULLsnmp_strcat()sprint_realloc_by_type()variable_list::typevariable_list::val.

参照元 set_function()snprint_counter()sprint_realloc_by_type().

int sprint_realloc_counter64 ( u_char **  buf,
size_t *  buf_len,
size_t *  out_len,
int  allow_realloc,
const netsnmp_variable_list var,
const struct enum_list enums,
const char *  hint,
const char *  units 
)

Prints a counter into a buffer.

The variable var is encoded as a counter value.

If allow_realloc is true the buffer will be (re)allocated to fit in the needed size. (Note: *buf may change due to this.)

引数:
buf Address of the buffer to print to.
buf_len Address to an integer containing the size of buf.
out_len Incremented by the number of characters printed.
allow_realloc if not zero reallocate the buffer to fit the needed size.
var The variable to encode.
enums The enumeration ff this variable is enumerated. may be NULL.
hint Contents of the DISPLAY-HINT clause of the MIB. See RFC 1903 Section 3.1 for details. may be NULL.
units Contents of the UNITS clause of the MIB. may be NULL.
戻り値:
1 on success, or 0 on failure (out of memory, or buffer to small when not allowed to realloc.)

mib.c871 行で定義されています。

参照先 netsnmp_vardata::counter64netsnmp_ds_get_boolean()NULLsnmp_strcat()sprint_realloc_by_type()variable_list::typevariable_list::val.

参照元 set_function()snprint_counter64()sprint_realloc_by_type()sprint_realloc_opaque().

int sprint_realloc_gauge ( u_char **  buf,
size_t *  buf_len,
size_t *  out_len,
int  allow_realloc,
const netsnmp_variable_list var,
const struct enum_list enums,
const char *  hint,
const char *  units 
)

Prints a gauge value into a buffer.

If allow_realloc is true the buffer will be (re)allocated to fit in the needed size. (Note: *buf may change due to this.)

引数:
buf Address of the buffer to print to.
buf_len Address to an integer containing the size of buf.
out_len Incremented by the number of characters printed.
allow_realloc if not zero reallocate the buffer to fit the needed size.
var The variable to encode.
enums The enumeration ff this variable is enumerated. may be NULL.
hint Contents of the DISPLAY-HINT clause of the MIB. See RFC 1903 Section 3.1 for details. may be NULL.
units Contents of the UNITS clause of the MIB. may be NULL.
戻り値:
1 on success, or 0 on failure (out of memory, or buffer to small when not allowed to realloc.)

mib.c1493 行で定義されています。

参照先 netsnmp_vardata::integernetsnmp_ds_get_boolean()NULLsnmp_strcat()sprint_realloc_by_type()sprint_realloc_hinted_integer()variable_list::typevariable_list::val.

参照元 set_function()snprint_gauge()sprint_realloc_by_type().

int sprint_realloc_hinted_integer ( u_char **  buf,
size_t *  buf_len,
size_t *  out_len,
int  allow_realloc,
long  val,
const char  decimaltype,
const char *  hint,
const char *  units 
)

Prints an integer according to the hint into a buffer.

If allow_realloc is true the buffer will be (re)allocated to fit in the needed size. (Note: *buf may change due to this.)

引数:
buf Address of the buffer to print to.
buf_len Address to an integer containing the size of buf.
out_len Incremented by the number of characters printed.
allow_realloc if not zero reallocate the buffer to fit the needed size.
val The variable to encode.
decimaltype The enumeration ff this variable is enumerated. may be NULL.
hint Contents of the DISPLAY-HINT clause of the MIB. See RFC 1903 Section 3.1 for details. may _NOT_ be NULL.
units Contents of the UNITS clause of the MIB. may be NULL.
戻り値:
1 on success, or 0 on failure (out of memory, or buffer to small when not allowed to realloc.)

mib.c1219 行で定義されています。

参照先 snmp_strcat().

参照元 snprint_hinted_integer()sprint_realloc_gauge().

int sprint_realloc_integer ( u_char **  buf,
size_t *  buf_len,
size_t *  out_len,
int  allow_realloc,
const netsnmp_variable_list var,
const struct enum_list enums,
const char *  hint,
const char *  units 
)

Prints an integer into a buffer.

If allow_realloc is true the buffer will be (re)allocated to fit in the needed size. (Note: *buf may change due to this.)

引数:
buf Address of the buffer to print to.
buf_len Address to an integer containing the size of buf.
out_len Incremented by the number of characters printed.
allow_realloc if not zero reallocate the buffer to fit the needed size.
var The variable to encode.
enums The enumeration ff this variable is enumerated. may be NULL.
hint Contents of the DISPLAY-HINT clause of the MIB. See RFC 1903 Section 3.1 for details. may be NULL.
units Contents of the UNITS clause of the MIB. may be NULL.
戻り値:
1 on success, or 0 on failure (out of memory, or buffer to small when not allowed to realloc.)

mib.c1293 行で定義されています。

参照先 netsnmp_vardata::integerenum_list::labelnetsnmp_ds_get_boolean()enum_list::nextNULLsnmp_strcat()sprint_realloc_by_type()variable_list::typevariable_list::valenum_list::value.

参照元 set_function()snprint_integer()sprint_realloc_by_type().

int sprint_realloc_ipaddress ( u_char **  buf,
size_t *  buf_len,
size_t *  out_len,
int  allow_realloc,
const netsnmp_variable_list var,
const struct enum_list enums,
const char *  hint,
const char *  units 
)

Prints an ip-address into a buffer.

If allow_realloc is true the buffer will be (re)allocated to fit in the needed size. (Note: *buf may change due to this.)

引数:
buf Address of the buffer to print to.
buf_len Address to an integer containing the size of buf.
out_len Incremented by the number of characters printed.
allow_realloc if not zero reallocate the buffer to fit the needed size.
var The variable to encode.
enums The enumeration ff this variable is enumerated. may be NULL.
hint Contents of the DISPLAY-HINT clause of the MIB. See RFC 1903 Section 3.1 for details. may be NULL.
units Contents of the UNITS clause of the MIB. may be NULL.
戻り値:
1 on success, or 0 on failure (out of memory, or buffer to small when not allowed to realloc.)

mib.c1695 行で定義されています。

参照先 netsnmp_ds_get_boolean()NULLsnmp_realloc()snmp_strcat()sprint_realloc_by_type()netsnmp_vardata::stringvariable_list::typevariable_list::val.

参照元 set_function()snprint_ipaddress()sprint_realloc_by_type().

int sprint_realloc_networkaddress ( u_char **  buf,
size_t *  buf_len,
size_t *  out_len,
int  allow_realloc,
const netsnmp_variable_list var,
const struct enum_list enums,
const char *  hint,
const char *  units 
)

Prints a network address into a buffer.

If allow_realloc is true the buffer will be (re)allocated to fit in the needed size. (Note: *buf may change due to this.)

引数:
buf Address of the buffer to print to.
buf_len Address to an integer containing the size of buf.
out_len Incremented by the number of characters printed.
allow_realloc if not zero reallocate the buffer to fit the needed size.
var The variable to encode.
enums The enumeration ff this variable is enumerated. may be NULL.
hint Contents of the DISPLAY-HINT clause of the MIB. See RFC 1903 Section 3.1 for details. may be NULL.
units Contents of the UNITS clause of the MIB. may be NULL.
戻り値:
1 on success, or 0 on failure (out of memory, or buffer to small when not allowed to realloc.)

mib.c1629 行で定義されています。

参照先 netsnmp_ds_get_boolean()NULLsnmp_realloc()snmp_strcat()sprint_realloc_by_type()netsnmp_vardata::stringvariable_list::typevariable_list::valvariable_list::val_len.

参照元 set_function()snprint_networkaddress().

int sprint_realloc_null ( u_char **  buf,
size_t *  buf_len,
size_t *  out_len,
int  allow_realloc,
const netsnmp_variable_list var,
const struct enum_list enums,
const char *  hint,
const char *  units 
)

Prints a null value into a buffer.

If allow_realloc is true the buffer will be (re)allocated to fit in the needed size. (Note: *buf may change due to this.)

引数:
buf Address of the buffer to print to.
buf_len Address to an integer containing the size of buf.
out_len Incremented by the number of characters printed.
allow_realloc if not zero reallocate the buffer to fit the needed size.
var The variable to encode.
enums The enumeration ff this variable is enumerated. may be NULL.
hint Contents of the DISPLAY-HINT clause of the MIB. See RFC 1903 Section 3.1 for details. may be NULL.
units Contents of the UNITS clause of the MIB. may be NULL.
戻り値:
1 on success, or 0 on failure (out of memory, or buffer to small when not allowed to realloc.)

mib.c1755 行で定義されています。

参照先 netsnmp_ds_get_boolean()NULLsnmp_strcat()sprint_realloc_by_type()variable_list::type.

参照元 set_function()snprint_null()sprint_realloc_by_type().

int sprint_realloc_object_identifier ( u_char **  buf,
size_t *  buf_len,
size_t *  out_len,
int  allow_realloc,
const netsnmp_variable_list var,
const struct enum_list enums,
const char *  hint,
const char *  units 
)

Prints an object identifier into a buffer.

If allow_realloc is true the buffer will be (re)allocated to fit in the needed size. (Note: *buf may change due to this.)

引数:
buf Address of the buffer to print to.
buf_len Address to an integer containing the size of buf.
out_len Incremented by the number of characters printed.
allow_realloc if not zero reallocate the buffer to fit the needed size.
var The variable to encode.
enums The enumeration ff this variable is enumerated. may be NULL.
hint Contents of the DISPLAY-HINT clause of the MIB. See RFC 1903 Section 3.1 for details. may be NULL.
units Contents of the UNITS clause of the MIB. may be NULL.
戻り値:
1 on success, or 0 on failure (out of memory, or buffer to small when not allowed to realloc.)

mib.c1075 行で定義されています。

参照先 netsnmp_ds_get_boolean()netsnmp_sprint_realloc_objid_tree()NULLnetsnmp_vardata::objidsnmp_strcat()sprint_realloc_by_type()variable_list::typevariable_list::valvariable_list::val_len.

参照元 set_function()snprint_object_identifier()sprint_realloc_by_type().

int sprint_realloc_octet_string ( u_char **  buf,
size_t *  buf_len,
size_t *  out_len,
int  allow_realloc,
const netsnmp_variable_list var,
const struct enum_list enums,
const char *  hint,
const char *  units 
)

Prints an octet string into a buffer.

The variable var is encoded as octet string.

If allow_realloc is true the buffer will be (re)allocated to fit in the needed size. (Note: *buf may change due to this.)

引数:
buf Address of the buffer to print to.
buf_len Address to an integer containing the size of buf.
out_len Incremented by the number of characters printed.
allow_realloc if not zero reallocate the buffer to fit the needed size.
var The variable to encode.
enums The enumeration ff this variable is enumerated. may be NULL.
hint Contents of the DISPLAY-HINT clause of the MIB. See RFC 1903 Section 3.1 for details. may be NULL.
units Contents of the UNITS clause of the MIB. may be NULL.
戻り値:
1 on success, or 0 on failure (out of memory, or buffer to small when not allowed to realloc.)

mib.c427 行で定義されています。

参照先 netsnmp_ds_get_boolean()netsnmp_ds_get_int()NULLsnmp_realloc()snmp_strcat()sprint_realloc_asciistring()sprint_realloc_by_type()sprint_realloc_hexstring()sprint_realloc_octet_string()netsnmp_vardata::stringvariable_list::typevariable_list::valvariable_list::val_len.

参照元 set_function()snprint_octet_string()sprint_realloc_by_type()sprint_realloc_octet_string().

int sprint_realloc_opaque ( u_char **  buf,
size_t *  buf_len,
size_t *  out_len,
int  allow_realloc,
const netsnmp_variable_list var,
const struct enum_list enums,
const char *  hint,
const char *  units 
)

Prints an object identifier into a buffer.

If allow_realloc is true the buffer will be (re)allocated to fit in the needed size. (Note: *buf may change due to this.)

引数:
buf Address of the buffer to print to.
buf_len Address to an integer containing the size of buf.
out_len Incremented by the number of characters printed.
allow_realloc if not zero reallocate the buffer to fit the needed size.
var The variable to encode.
enums The enumeration ff this variable is enumerated. may be NULL.
hint Contents of the DISPLAY-HINT clause of the MIB. See RFC 1903 Section 3.1 for details. may be NULL.
units Contents of the UNITS clause of the MIB. may be NULL.
戻り値:
1 on success, or 0 on failure (out of memory, or buffer to small when not allowed to realloc.)

mib.c985 行で定義されています。

参照先 netsnmp_ds_get_boolean()NULLsnmp_strcat()sprint_realloc_by_type()sprint_realloc_counter64()sprint_realloc_hexstring()netsnmp_vardata::stringvariable_list::typevariable_list::valvariable_list::val_len.

参照元 set_function()snprint_opaque()sprint_realloc_by_type().

int sprint_realloc_timeticks ( u_char **  buf,
size_t *  buf_len,
size_t *  out_len,
int  allow_realloc,
const netsnmp_variable_list var,
const struct enum_list enums,
const char *  hint,
const char *  units 
)

Prints a timetick variable into a buffer.

If allow_realloc is true the buffer will be (re)allocated to fit in the needed size. (Note: *buf may change due to this.)

引数:
buf Address of the buffer to print to.
buf_len Address to an integer containing the size of buf.
out_len Incremented by the number of characters printed.
allow_realloc if not zero reallocate the buffer to fit the needed size.
var The variable to encode.
enums The enumeration ff this variable is enumerated. may be NULL.
hint Contents of the DISPLAY-HINT clause of the MIB. See RFC 1903 Section 3.1 for details. may be NULL.
units Contents of the UNITS clause of the MIB. may be NULL.
戻り値:
1 on success, or 0 on failure (out of memory, or buffer to small when not allowed to realloc.)

mib.c1145 行で定義されています。

参照先 netsnmp_vardata::integernetsnmp_ds_get_boolean()NULLsnmp_strcat()sprint_realloc_by_type()variable_list::typevariable_list::val.

参照元 set_function()snprint_timeticks()sprint_realloc_by_type().

int sprint_realloc_uinteger ( u_char **  buf,
size_t *  buf_len,
size_t *  out_len,
int  allow_realloc,
const netsnmp_variable_list var,
const struct enum_list enums,
const char *  hint,
const char *  units 
)

Prints an unsigned integer into a buffer.

If allow_realloc is true the buffer will be (re)allocated to fit in the needed size. (Note: *buf may change due to this.)

引数:
buf Address of the buffer to print to.
buf_len Address to an integer containing the size of buf.
out_len Incremented by the number of characters printed.
allow_realloc if not zero reallocate the buffer to fit the needed size.
var The variable to encode.
enums The enumeration ff this variable is enumerated. may be NULL.
hint Contents of the DISPLAY-HINT clause of the MIB. See RFC 1903 Section 3.1 for details. may be NULL.
units Contents of the UNITS clause of the MIB. may be NULL.
戻り値:
1 on success, or 0 on failure (out of memory, or buffer to small when not allowed to realloc.)

mib.c1396 行で定義されています。

参照先 netsnmp_vardata::integerenum_list::labelnetsnmp_ds_get_boolean()enum_list::nextNULLsnmp_strcat()sprint_realloc_by_type()variable_list::typevariable_list::valenum_list::value.

参照元 set_function()snprint_uinteger()sprint_realloc_by_type().

char* uptime_string ( u_long  timeticks,
char *  buf 
)

Converts timeticks to hours, minutes, seconds string.

CMU compatible does not show centiseconds.

引数:
timeticks The timeticks to convert.
buf Buffer to write to, has to be at least 40 Bytes large.
戻り値:
The buffer
参照:
uptimeString

mib.c5782 行で定義されています。

参照先 uptime_string_n().


変数

PrefixList mib_prefixes[]

初期値:

 {
    {&Standard_Prefix[0]},      
    {".iso.org.dod.internet.mgmt.mib-2"},
    {".iso.org.dod.internet.experimental"},
    {".iso.org.dod.internet.private"},
    {".iso.org.dod.internet.snmpParties"},
    {".iso.org.dod.internet.snmpSecrets"},
    {NULL, 0}                   
}

mib.c160 行で定義されています。

参照元 init_mib()netsnmp_sprint_realloc_objid_tree().


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