SYNAPSE - Synchronous TCP/IP Library for Delphi
Other related information can be found at http://www.mlp.cz/space/gebauerl/synapse/
Class: TSNMPrec (data object abstracts SNMP data packet)
- Properties:
- version:integer
Version of SNMP packet. Default value is 0 (SNMP ver. 1).
- community:string
Community string for autorize access to SNMP server. (Case sensitive!)
- PDUType:integer
Define type of SNMP operation. Supported values are: PDUGetRequest, PDUGetNextRequest, PDUSetRequest.
- ID:integer
Contains ID number. Not need to use.
- ErrorStatus
vhen packet is reply, contains error code. Supported values are: ENoError, ETooBig, ENoSuchName, EBadValue, EReadOnly, EGenErr.
- ErrorIndex:integer
Point to error position in reply packet. Not usefull for users.
- MIBOID:TStringList
List of MIO OID (Object Idetifier). Recommend use throw object method.
- MIBValue:TStringList
List of values correspond to OID. Point to error position in reply packet. Recommend use throw object method.
- Methods:
- Procedure DecodeBuf(Buffer:string)
Decode SNMP packet in buffer to object properties.
- Function EncodeBuf:string
Encode obejct properties to SNMP packet.
- Procedure Clear
Clears all object properties to default values.
- Procedure MIBAdd(MIB,Value:string)
Add entry to MIBOID and MIBValue. For query use value as empty string.
- Procedure MIBdelete(Index:integer)
Delete entry from both lists MIBOID and MIBValue.
- Function MIBGet(MIB:string):string
Search MIBOID list for MIB and return correspond value from MIBValue.
Class: TSNMPSend
- Properties:
- Timeout:integer
Define timeout in second for all SNMP operations. Default value is 5 seconds.
- SNMPhost:String
Address of SNMP server (IP address or domain name) where you want to connect.
- Query:TSNMPrec
Data object contains SNMP query.
- Reply:TSNMPrec
Data object contains SNMP reply.
- Methods:
- Function DoIt:boolean
Connects to a SNMPHost and send there query. If in timeout SNMP server send back query, result is true.
- Not class (but cohere) functions:
- Function SNMPget (Mib, Community, SNMPHost:string; var Value:string):Boolean
This is useful function and example of use TSNMPSend object. It implement basic GET method of SNMP protocol. If SNMP operation successful, result is true. Then value is readed value of requested MIB OID from SNMPHost with Community access identifier.