netsnmp_library3snmp
The net-snmp library
Define Documentation
#define timercmp(tvp, uvp, cmp) Value:
/* CSTYLED */ ((tvp)->tv_sec cmp (uvp)->tv_sec || ((tvp)->tv_sec == (uvp)->tv_sec && /* CSTYLED */ (tvp)->tv_usec cmp (uvp)->tv_usec))
Definition at line 148 of file snmp_api.c.
Function Documentation
int _sess_read (void * sessp, fd_set * fdset)
XXX-rks: why no SNMP_FREE(isp->packet); ??
XXX-rks: why no SNMP_FREE(isp->packet); ??
Definition at line 5412 of file snmp_api.c.
int init_agent (const char * app)
Initialize the agent. Calls into init_agent_read_config to set tha app's configuration file in the appropriate default storage space, NETSNMP_DS_LIB_APPTYPE. Need to call init_agent before calling init_snmp.
Parameters:
app the configuration file to be read in, gets stored in default storage
Returns:
Returns non-zero on failure and zero on success.
See also:
init_snmp
Definition at line 270 of file snmp_vars.c.
void init_snmp (const char * type)
Calls the functions to do config file loading and mib module parsing in the correct order. Parameters:
type label for the config file 'type'
Returns:
void
See also:
init_agent
Definition at line 787 of file snmp_api.c.
int netsnmp_oid_compare_ll (const oid * in_name1, size_t len1, const oid * in_name2, size_t len2, size_t * offpt)
lexicographical compare two object identifiers and return the point where they differ Caution: this method is called often by command responder applications (ie, agent).
Returns:
-1 if name1 < name2, 0 if name1 = name2, 1 if name1 > name2 and offpt = len where name1 != name2
Definition at line 6350 of file snmp_api.c.
int netsnmp_oid_equals (const oid * in_name1, size_t len1, const oid * in_name2, size_t len2)
Compares 2 OIDs to determine if they are exactly equal. This should be faster than doing a snmp_oid_compare for different length OIDs, since the length is checked first and if != returns immediately. Might be very slighly faster if lengths are ==.
Parameters:
in_name1 A pointer to the first oid.
len1 length of the first OID (in segments, not bytes)
in_name2 A pointer to the second oid.
len2 length of the second OID (in segments, not bytes)
Returns:
0 if they are equal, 1 if they are not.
Definition at line 6431 of file snmp_api.c.
int netsnmp_oid_find_prefix (const oid * in_name1, size_t len1, const oid * in_name2, size_t len2)
Given two OIDs, determine the common prefix to them both. Parameters:
in_name1 A pointer to the first oid.
len1 Length of the first oid.
in_name2 A pointer to the second oid.
len2 Length of the second oid.
Returns:
length of largest common index of commonality. 1 = first, 0 if none * or -1 on error.
Definition at line 6487 of file snmp_api.c.
int netsnmp_oid_is_subtree (const oid * in_name1, size_t len1, const oid * in_name2, size_t len2)
Identical to netsnmp_oid_equals, except only the length up to len1 is compared. Functionally, this determines if in_name2 is equal or a subtree of in_name1
Parameters:
in_name1 A pointer to the first oid.
len1 length of the first OID (in segments, not bytes)
in_name2 A pointer to the second oid.
len2 length of the second OID (in segments, not bytes)
Returns:
0 if one is a common prefix of the other.
Definition at line 6467 of file snmp_api.c.
int snmp_oid_compare (const oid * in_name1, size_t len1, const oid * in_name2, size_t len2)
lexicographical compare two object identifiers. Caution: this method is called often by command responder applications (ie, agent).
Returns:
-1 if name1 < name2, 0 if name1 = name2, 1 if name1 > name2
Definition at line 6301 of file snmp_api.c.
int snmp_oidtree_compare (const oid * in_name1, size_t len1, const oid * in_name2, size_t len2)
Compares 2 OIDs to determine if they are equal up until the shortest length. Parameters:
in_name1 A pointer to the first oid.
len1 length of the first OID (in segments, not bytes)
in_name2 A pointer to the second oid.
len2 length of the second OID (in segments, not bytes)
Returns:
0 if they are equal, 1 if in_name1 is > in_name2, or -1 if <.
Definition at line 6403 of file snmp_api.c.
void snmp_shutdown (const char * type)
Shuts down the application, saving any needed persistent storage, and appropriate clean up. Parameters:
type Label for the config file 'type' used
Returns:
void
Definition at line 853 of file snmp_api.c.
int snmpv3_engineID_probe (struct session_list * slp, netsnmp_session * in_session)
probe for peer engineID Parameters:
slp session list pointer.
in_session session for errors
Note:
•
|
called by _sess_open(), snmp_sess_add_ex() |
|---|---|
•
|
in_session is the user supplied session provided to those functions. |
•
|
the first session in slp should the internal allocated copy of in_session |
Returns:
0 : error
1 : ok
Definition at line 1276 of file snmp_api.c.
Releases
5 releases since Debian 3.1 (Sarge); the text changed 3 times.