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

version» Context lines:

pike.git/lib/modules/Protocols.pmod/SNMP.pmod/agent.pike:22:       set_blocking();    mapping rv=decode_asn1_msg(rdata);       mapping varlist=([]);       array n=indices(rv);       if(rv[n[0]])    { -  if(managers_security_mode && search(managers_list, -  get_host_from_ip(rdata->ip))==-1) +  if(managers_security_mode && !has_value(managers_list, +  get_host_from_ip(rdata->ip)))    // we want to check managers list, and this request is coming    // from a non manager, so let us ignore it.    {    return;    }    if(rv[n[0]]->op==Protocols.SNMP.REQUEST_GET || rv[n[0]]->op==Protocols.SNMP.REQUEST_GETNEXT) // are we a Get?    { -  if(search(get_community_list, rv[n[0]]->community)==-1) +  if(!has_value(get_community_list, rv[n[0]]->community))    // let us ignore bad communities    {    return;    }    foreach(rv[n[0]]->attribute, mapping att)    {    foreach(indices(att), string oid)    {    if(oid_get_callbacks[oid])    {
pike.git/lib/modules/Protocols.pmod/SNMP.pmod/agent.pike:67:    }    else varlist[oid]=r[1..];    }    }    }    if(varlist && sizeof(varlist)>0)    get_response(varlist, rv);    }    else if(rv[n[0]]->op==Protocols.SNMP.REQUEST_SET) // are we a Set?    { -  if(search(set_community_list, rv[n[0]]->community)==-1) +  if(!has_value(set_community_list, rv[n[0]]->community))    // let us ignore bad communities    {    return;    }    foreach(rv[n[0]]->attribute, mapping att)    {    foreach(indices(att), string oid)    {    if(oid_set_callbacks[oid])    {