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

version» Context lines:

pike.git/lib/modules/Protocols.pmod/SNMP.pmod/protocol.pike:10:   //! 1155-7 : v1   //!   //! 1901-4 : v2/community (Bulk ops aren't implemented!)   //!   //! planned:   //! 2742 : agentX   //!   //! 2570 : v3 description   //!    - // $Id: protocol.pike,v 1.10 2002/12/04 19:14:00 bill Exp $ + // $Id: protocol.pike,v 1.11 2003/04/23 14:01:57 nilsson 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:653:    //: Trap-PDU low call    object pdu;    int id = get_req_id(), flg;    array vararr = ({});    string lip = "1234";      // DWRITE(sprintf("protocols.trap: varlist: %O, oid: %O, type: %O, spectype: %O,"   // " ticks: %O, locip: %O, remaddr: %O, remport: %O\n",   // varlist, oid, type, spectype, ticks, locip, remaddr, remport));    locip = locip || "0.0.0.0"; +  if (has_value(locip,":")) // FIXME: Can't handle IPv6 +  locip = "0.0.0.0";    if (sizeof(locip/".") != 4)    locip = "0.0.0.0"; //FIXME: what for hell I want to do with such ugly value?    //sscanf(locip, "%d.%d.%d.%d", @lip);    sscanf(locip, "%d.%d.%d.%d", lip[0], lip[1], lip[2], lip[3]);       foreach(indices(varlist), string varname)    vararr += ({Standards.ASN1.Types.asn1_sequence(    ({Standards.ASN1.Types.asn1_identifier(    @Array.map(varname/".", lambda(string el){ return((int)el);})),    mk_asn1_val(varlist[varname][0], varlist[varname][1])})