Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

Service API

used to create / delete SnmpCtxS objects and to define service handles More...

Defines

#define MQ_ERROR_S   msgque->error

Functions

void usage (SnmpCtxSP)
 print usage message to stdout
MqErrorE Ot_INIT (MqSP, void *)
 service that creates a snmp session
MqErrorE Ot_CLOS (MqSP, void *)
 service that closes a snmp session
MqErrorE Ot_BGET (MqSP, void *)
 service that uses the SNMP GETBULK request to query a network entity efficiently for information.
MqErrorE Ot_GETO (MqSP, void *)
 service that uses the SNMP GET request to query for information on a network entity
MqErrorE Ot_WALK (MqSP, void *)
 service that uses SNMP GETNEXT requests to query a network entity for a tree of information
MqErrorE Ot_BWLK (MqSP, void *)
 service that uses SNMP GETBULK requests to query a network entity efficiently for a tree of information
MqErrorE Ot_SOPU (MqSP, void *)
 service that toggles output options
MqErrorE Ot_TEST (MqSP, void *)
 service for testing purpose
MqErrorE Ot_TREE (MqSP, void *)
 service that query a network entity for a OID tree
MqErrorE ContextCreate (MqBufferLS *const argv, SnmpCtxSP *out)
 create a context
void ContextDelete (SnmpCtxSP *contextP)
 delete a SnmpCtxS object

Detailed Description

used to create / delete SnmpCtxS objects and to define service handles


Define Documentation

#define MQ_ERROR_S   msgque->error
 

Definition at line 27 of file context.c.


Function Documentation

MqErrorE ContextCreate MqBufferLS *const   argv,
SnmpCtxSP *  out
 

create a context

Parameters:
[in] argv an array of options used for configuration
[out] out a pointer to the SnmpCtxS object

Definition at line 708 of file context.c.

References ContextCreate(), ContextDelete(), ContextSP, MQ_ERROR_PROC_FMT, MqBufferCreate(), MqBufferLAppendHP(), MqCreate(), MqErrorCheck, MqErrorSAppendV(), MqServiceCreate(), MqSysCalloc(), Ot_INIT(), and Ot_TEST().

Referenced by ContextCreate(), and main().

void ContextDelete SnmpCtxSP *  contextP  ) 
 

delete a SnmpCtxS object

Parameters:
[in,out] contextP a pointer to the SnmpCtxS object, set to NULL

Definition at line 741 of file context.c.

References MQ_PTR, MqBufferDelete(), MqDelete(), and MqSysFree().

Referenced by ContextCreate(), and main().

MqErrorE Ot_BGET MqSP  msgque,
void *  data
[static]
 

service that uses the SNMP GETBULK request to query a network entity efficiently for information.

SNMP GETBULK read a sequential list of information items up to -Cr option per OID starting with the first item after the given OID. if more than one OID was given the -Cn option is used to provide the number of information items not be repeated.

Usage:
BGET [option]... OID...

Option:
option type description
-Cn NUM integer set non-repeaters to NUM (default: 0)
-Cr NUM integer set max-repeaters to NUM (default: 10)

Service:
define BGET, that uses the SNMP GETBULK request to query a network entity efficiently for information
Parameters:
[in] msgque object to work on
[in] data not used
Returns:
libFreiburg 2.0 error-status
Example:
 > BGET -Cn 1 -Cr 2 sysContact.0 sysORDescr.1
SNMPv2-MIB::sysName.0 ...
SNMPv2-MIB::sysORDescr.2 ...
SNMPv2-MIB::sysORDescr.3 ...
  1. the next information item after sysContact.0 is sysName.0
  2. sysContact.0 will be not repeated
  3. the next information item after sysORDescr.1 is sysORDescr.2
  4. sysORDescr.1 will be 2 times repeated -> sysORDescr.2 and sysORDescr.3

Definition at line 298 of file context.c.

References ApiGetOidAndSend(), BGET_LEN, MQ_ERROR_PROC_FMT, MQ_ERROR_S, MQ_PTR, MqErrorCheck, MqOptDefault(), MqOptGet(), MqSend_RET_OK(), MqSendEND_RETR(), MqSendRETURN(), MqSendSP, MqSendSTART(), MqSP, MqSysFree(), and MqS::send.

Referenced by Ot_INIT().

MqErrorE Ot_BWLK MqSP  msgque,
void *  data
[static]
 

service that uses SNMP GETBULK requests to query a network entity efficiently for a tree of information

Usage:
BWLK [option]... [OID]

Option:
option type description
-Cc boolean do not check returned OIDs are increasing
-Ci boolean include given OID in the search range
-Cp boolean print the number of variables found
-Ct boolean display wall-clock time to complete the request
-Cn NUM integer set non-repeaters to NUM (default: 0)
-Cr NUM integer set max-repeaters to NUM (default: 10)

Service:
define BWLK, that uses SNMP GETBULK requests to query a network entity efficiently for a tree of information
Parameters:
[in] msgque object to work on
[in] data not used
Returns:
libFreiburg 2.0 error-status

Definition at line 454 of file context.c.

References ApiWalkOidAndSend(), BWLK_LEN, MQ_ERROR_PROC_FMT, MQ_ERROR_S, MQ_PTR, MqErrorCheck, MqOptDefault(), MqOptGet(), MqSend_RET_OK(), MqSendEND_RETR(), MqSendRETURN(), MqSendSP, MqSendSTART(), MqSP, MqSysFree(), and MqS::send.

Referenced by Ot_INIT().

MqErrorE Ot_CLOS MqSP  msgque,
void *  data
[static]
 

service that closes a snmp session

Usage:
CLOS

Service:
define CLOS, that closes a snmp session

add service: INIT

del service: BGET, BWLK, GETO, SOPU WALK, TREE, CLOS

Parameters:
[in] msgque object to work on
[in] data not used
Returns:
libFreiburg 2.0 error-status

Definition at line 242 of file context.c.

References ErrorSnmp(), MQ_ERROR_PROC_FMT, MQ_ERROR_S, MqErrorCheck, MqErrorReset(), MqSendRETURN(), MqServiceCreate(), MqServiceDelete(), MqSP, MqS::myCtx, Ot_INIT(), and Ot_TEST().

Referenced by Ot_INIT().

MqErrorE Ot_GETO MqSP  msgque,
void *  data
[static]
 

service that uses the SNMP GET request to query for information on a network entity

Usage:
GETO [option]... OID...

Option:
option type description
-Cf boolean do not fix errors and retry the request

Service:
define GETO, that uses the SNMP GET request to query for information on a network entity
Parameters:
[in] msgque object to work on
[in] data not used
Returns:
libFreiburg 2.0 error-status

Definition at line 347 of file context.c.

References ApiGetOidAndSend(), GETO_LEN, MQ_ERROR_PROC_FMT, MQ_ERROR_S, MQ_PTR, MqErrorCheck, MqOptDefault(), MqOptGet(), MqSend_RET_OK(), MqSendEND_RETR(), MqSendRETURN(), MqSendSP, MqSendSTART(), MqSP, MqSysFree(), and MqS::send.

Referenced by Ot_INIT().

MqErrorE Ot_INIT MqSP  msgque,
void *  data
[static]
 

service that creates a snmp session

Usage:
INIT [option]...

Option:
Misc
option type description
-h, --help boolean display the help message
-H boolean display configuration file directives understood
-v 1|2c|3 1|2c|3 specifies SNMP version to use
-V, --version boolean display package version number

SNMP Version 1 or 2c specific
-c COMMUNITY string set the community string

SNMP Version 3 specific
-a PROTOCOL MD5|SHA set authentication protocol
-A PASSPHRASE string set authentication protocol pass phrase
-e ENGINE-ID string set security engine ID (e.g. 800000020109840301)
-E ENGINE-ID string context engine ID (e.g. 800000020109840301)
-l LEVEL noAuthNoPriv
authNoPriv
authPriv
set security level
-n CONTEXT string set context name (e.g. bridge1)
-u USER-NAME string set security name (e.g. bert)
-x PROTOCOL DES set privacy protocol
-X PASSPHRASE string set privacy protocol pass phrase
-Z BOOTS-TIME string set destination engine boots/time

General communication options
-r RETRIES integer set the number of retries
-t TIMEOUT seconds set the request timeout

Debugging
-d boolean dump input/output packets in hexadecimal
-D TOKEN[,...] string turn on debugging output for the specified TOKENs
(ALL gives extremely verbose debugging output)

General options
-m MIB[:...] string load given list of MIBs (ALL loads everything)
-M DIR[:...] string look in given list of directories for MIBs
-P MIBOPTS flag chars Toggle various defaults controlling MIB parsing
u allow the use of underlines in MIB symbols
c disallow the use of "--" to terminate comments
d save the Descriptions of the MIB objects
e disable errors when MIB symbols conflict
w enable warnings when MIB symbols conflict
W enable detailed warnings when MIB symbols conflict
R replace MIB symbols from latest module

Service:
define INIT, that creates a snmp session

add service: BGET, BWLK, GETO, SOPU WALK, TREE, CLOS

del service: INIT,

Parameters:
[in] msgque object to work on
[in] data not used
Returns:
libFreiburg 2.0 error-status

Definition at line 172 of file context.c.

References MQ_ERROR_PROC_FMT, MQ_ERROR_S, MqErrorC, MqErrorCheck, MqErrorReset(), MqReadArgv(), MqSendRETURN(), MqServiceCreate(), MqServiceDelete(), MqSP, MqS::myCtx, Ot_BGET(), Ot_BWLK(), Ot_CLOS(), Ot_GETO(), Ot_SOPU(), Ot_TREE(), Ot_WALK(), MqS::read, and usage().

Referenced by ContextCreate(), and Ot_CLOS().

MqErrorE Ot_SOPU MqSP  msgque,
void *  data
[static]
 

service that toggles output options

Usage:
SOPU [option]...

Option:
option type description
a boolean print all strings in ASCII format
b boolean do not break OID indexes down
e boolean print enums numerically
E boolean escape quotes in string indices
f boolean print full OIDs on output
n boolean print OIDs numerically
s boolean print only last symbolic element of OID
S boolean print MIB module-id plus last element
t boolean print timeticks unparsed as numeric integers
T boolean print human-readable text along with hex strings
u boolean print OIDs using UCD-style prefix suppression
U boolean don't print units
x boolean print all strings in hex format
X boolean extended index format

Service:
define SOPU, that toggles output options
Parameters:
[in] msgque object to work on
[in] data not used
Returns:
libFreiburg 2.0 error-status

Definition at line 520 of file context.c.

References MqBufferU::C, MqBufferS::cur, MQ_ERROR_PROC_FMT, MQ_ERROR_S, MqBufferSP, MqErrorCheck, MqErrorReset(), MqErrorV, MqReadU(), MqSendRETURN(), MqSendSP, MqSP, MqS::read, and MqS::send.

Referenced by Ot_INIT().

MqErrorE Ot_TEST MqSP  msgque,
void *  data
[static]
 

service for testing purpose

space for add/test new features

Usage:
TEST [option]... [ITEM]

Option:
option type description
--bulk boolean print a large amount of items
--incr NUM integer increment NUM by 1

Service:
define TEST, for testing purpose
Parameters:
[in] msgque object to work on
[in] data not used
Returns:
libFreiburg 2.0 error-status

Definition at line 560 of file context.c.

References MqOptionU::B, MqOptionU::I, MQ_ERROR_PROC_FMT, MQ_ERROR_S, MQ_INT4, MQ_PTR, MqErrorCheck, MqOptDefault(), MqOptGet(), MqSend4(), MqSend_RET_END(), MqSend_RET_OK(), MqSend_RET_START(), MqSendC(), MqSendEND_RETR(), MqSendH4(), MqSendRETURN(), MqSendSP, MqSendSTART(), MqSP, MqSysFree(), MqS::send, and TEST_LEN.

Referenced by ContextCreate(), and Ot_CLOS().

MqErrorE Ot_TREE MqSP  msgque,
void *  data
[static]
 

service that query a network entity for a OID tree

Usage:
SOPU [option]... [OID]...

Option:
option type description
-Ci flag chars Toggle various defaults controlling information included
a ACCESS field
m MODULE name
t TYPE field
s STATUS field
-Cd boolean do not include nodes
-Ce boolean do not include entries
-Ct boolean do not include table entries

Service:
define TREE, that query a network entity for a OID tree
Parameters:
[in] msgque object to work on
[in] data not used
Returns:
libFreiburg 2.0 error-status

Definition at line 640 of file context.c.

References MqBufferU::C, MqBufferS::cur, ErrorSnmp(), MQ_ERROR_PROC_FMT, MQ_ERROR_S, MQ_PTR, MqBufferInitFromString, MqBufferSP, MqErrorCheck, MqOptDefault(), MqOptGet(), MqReadGetNumItems(), MqReadSP, MqReadU(), MqSend_RET_OK(), MqSendEND_RETR(), MqSendRETURN(), MqSendSP, MqSendSTART(), MqSP, MqSysFree(), MqS::myCtx, MqS::read, MqS::send, SendSubtree(), and TREE_LEN.

Referenced by Ot_INIT().

MqErrorE Ot_WALK MqSP  msgque,
void *  data
[static]
 

service that uses SNMP GETNEXT requests to query a network entity for a tree of information

Usage:
WALK [option]... [OID]

Option:
option type description
-Cp boolean print the number of variables found
-Ci boolean include given OID in the search range
-Cc boolean do not check returned OIDs are increasing
-Ct boolean display wall-clock time to complete the request

Service:
define WALK, that uses SNMP GETNEXT requests to query a network entity for a tree of information
Parameters:
[in] msgque object to work on
[in] data not used
Returns:
libFreiburg 2.0 error-status

Definition at line 398 of file context.c.

References ApiWalkOidAndSend(), MQ_ERROR_PROC_FMT, MQ_ERROR_S, MQ_PTR, MqErrorCheck, MqOptDefault(), MqOptGet(), MqSend_RET_OK(), MqSendEND_RETR(), MqSendRETURN(), MqSendSP, MqSendSTART(), MqSP, MqSysFree(), MqS::send, and WALK_LEN.

Referenced by Ot_INIT().

void usage SnmpCtxSP  context  )  [static]
 

print usage message to stdout

Parameters:
[in] context object to work on

Definition at line 86 of file context.c.

References MqPanicC.

Referenced by Ot_INIT().


Generated on Thu Nov 25 09:08:51 2004 for snmpFreiburg by  doxygen 1.3.8-20040928