pike.git / lib / modules / Protocols.pmod / SNMP.pmod / protocol.pike

version» Context lines:

pike.git/lib/modules/Protocols.pmod/SNMP.pmod/protocol.pike:1:   #pike __REAL_VERSION__    - //: SNMP protocol implementation for Pike +    //:   //: Honza Petrous, 2000-10-07 (on the 'coding party' after user conference :) - //: - //: RFC: - //: implemented (yet): - //: 1155-7 : v1 - //: 1901-4 : v2/community (Bulk ops aren't implemented!) - //: planned: - // 2742 : agentX - //: 2570 : v3 description - //: + //! SNMP protocol implementation for Pike + //! + //! RFCs: + //! + //! implemented (yet): + //! 1155-7 : v1 + //! + //! 1901-4 : v2/community (Bulk ops aren't implemented!) + //! + //! planned: + //! 2742 : agentX + //! + //! 2570 : v3 description + //!    - // $Id: protocol.pike,v 1.5 2002/11/30 21:25:12 bill Exp $ + // $Id: protocol.pike,v 1.6 2002/11/30 22:33:51 bill Exp $         #include "snmp_globals.h"   #include "snmp_errors.h"      #if 1   // --- ASN.1 hack   class asn1_application_octet_string   {    inherit Standards.ASN1.Types.asn1_octet_string;
pike.git/lib/modules/Protocols.pmod/SNMP.pmod/protocol.pike:163:         //:   //: private variables   //:   int remote_port; // = SNMP_DEFAULT_PORT;   string local_host = SNMP_DEFAULT_HOST;   string remote_host;   int request_id = 1;   int next_id = 1; +  + //! SNMP version + //! + //! currently version 1 and 2 are supported.   int snmp_version = SNMP_DEFAULT_VERSION; -  +  + //! SNMP community string + //! + //! should be set to the appropriate SNMP community before sending a request.   string snmp_community = SNMP_DEFAULT_COMMUNITY; -  +    int snmp_errno = SNMP_SUCCESS;   int ok;      //:   //: msg pool   //:   mapping msgpool = ([]);      //:   //: callback support
pike.git/lib/modules/Protocols.pmod/SNMP.pmod/protocol.pike:547:   //! data type such as tick, oid, gauge, etc   //! @elem mixed data   //! data to return for oidn   //! @endarray   //! @endmapping   //! @param rem_addr   //! @param rem_port   //! remote address an UDP port to send request to (optional)   //! @returns   //! request ID + //! + //! @example + //! // set the value of 1.3.6.1.4.1.1882.2.1 to "blah". + //! object s=Protocols.SNMP.protocol(); + //! s->snmp_community="mysetcommunity"; + //! mapping req=(["1.3.6.1.4.1.1882.2.1": ({"string", "blah"})]); + //! int id=s->set_request(req, "172.21.124.32"); + //!   int set_request(mapping varlist, string|void rem_addr,    int|void rem_port) {    //: SetRequest-PDU low call    object pdu;    int id = get_req_id(), flg;    array vararr = ({});       foreach(indices(varlist), string varname)    vararr += ({Standards.ASN1.Types.asn1_sequence(    ({Standards.ASN1.Types.asn1_identifier(