public int getSecurityModel() { return requestEvent.getSecurityModel(); }
public int getSecurityModel() { return source.getSecurityModel(); }
protected OctetString getViewName(CommandResponderEvent req, CoexistenceInfo cinfo, int viewType) { return vacm.getViewName(cinfo.getContextName(), cinfo.getSecurityName(), req.getSecurityModel(), req.getSecurityLevel(), viewType); }
protected OctetString getViewName(CommandResponderEvent req, CoexistenceInfo cinfo, int viewType) { OctetString viewName = vacm.getViewName(cinfo.getContextName(), cinfo.getSecurityName(), req.getSecurityModel(), req.getSecurityLevel(), viewType); return viewName; }
try { event.getMessageDispatcher().returnResponsePdu(event.getMessageProcessingModel(), event.getSecurityModel(), event.getSecurityName(), event.getSecurityLevel(), pdu,
e.getSecurityModel(), e.getSecurityName(), e.getSecurityLevel(),
e.getSecurityModel(), e.getSecurityName(), e.getSecurityLevel(),
public synchronized void processPdu(CommandResponderEvent e) { PDU command = e.getPDU(); if (command != null) { if ((command.getType() != PDU.TRAP) && (command.getType() != PDU.V1TRAP) && (command.getType() != PDU.REPORT) && (command.getType() != PDU.RESPONSE)) { out.println(command.toString()); command.setErrorIndex(0); command.setErrorStatus(0); command.setType(PDU.RESPONSE); StatusInformation statusInformation = new StatusInformation(); StateReference ref = e.getStateReference(); try { e.getMessageDispatcher().returnResponsePdu(e. getMessageProcessingModel(), e.getSecurityModel(), e.getSecurityName(), e.getSecurityLevel(), command, e.getMaxSizeResponsePDU(), ref, statusInformation); } catch (MessageException ex) { err.println("Error while sending response: " + ex.getMessage()); LogFactory.getLogger(SnmpCommand.class).error(ex); } } } }
public synchronized void processPdu(CommandResponderEvent e) { PDU command = e.getPDU(); if (command != null) { System.out.println(command.toString()); if ((command.getType() != PDU.TRAP) && (command.getType() != PDU.V1TRAP) && (command.getType() != PDU.REPORT) && (command.getType() != PDU.RESPONSE)) { command.setErrorIndex(0); command.setErrorStatus(0); command.setType(PDU.RESPONSE); StatusInformation statusInformation = new StatusInformation(); StateReference ref = e.getStateReference(); try { e.getMessageDispatcher().returnResponsePdu(e.getMessageProcessingModel(), e.getSecurityModel(), e.getSecurityName(), e.getSecurityLevel(), command, e.getMaxSizeResponsePDU(), ref, statusInformation); } catch (MessageException ex) { System.err.println("Error while sending response: "+ex.getMessage()); LogFactory.getLogger(SnmpRequest.class).error(ex); } } } }
e.getMessageDispatcher().returnResponsePdu(e. getMessageProcessingModel(), e.getSecurityModel(), e.getSecurityName(), e.getSecurityLevel(),
/** * Sends a RESPONSE PDU to the source address of a INFORM request. * @param event * the <code>CommandResponderEvent</code> with the INFORM request. * @throws * MessageException if the response could not be created and sent. */ protected void sendInformResponse(CommandResponderEvent event) throws MessageException { PDU responsePDU = (PDU) event.getPDU().clone(); responsePDU.setType(PDU.RESPONSE); responsePDU.setErrorStatus(PDU.noError); responsePDU.setErrorIndex(0); messageDispatcher.returnResponsePdu(event.getMessageProcessingModel(), event.getSecurityModel(), event.getSecurityName(), event.getSecurityLevel(), responsePDU, event.getMaxSizeResponsePDU(), event.getStateReference(), new StatusInformation()); } }
/** * Sends a RESPONSE PDU to the source address of a INFORM request. * @param event * the <code>CommandResponderEvent</code> with the INFORM request. * @throws * MessageException if the response could not be created and sent. */ protected void sendInformResponse(CommandResponderEvent event) throws MessageException { PDU responsePDU = (PDU) event.getPDU().clone(); responsePDU.setType(PDU.RESPONSE); responsePDU.setErrorStatus(PDU.noError); responsePDU.setErrorIndex(0); messageDispatcher.returnResponsePdu(event.getMessageProcessingModel(), event.getSecurityModel(), event.getSecurityName(), event.getSecurityLevel(), responsePDU, event.getMaxSizeResponsePDU(), event.getStateReference(), new StatusInformation()); } }
/** * Sends a RESPONSE PDU to the source address of a INFORM request. * * @param event * the <code>CommandResponderEvent</code> with the INFORM request. * * @throws MessageException * if the response could not be created and sent. */ protected void sendInformResponse(CommandResponderEvent event) throws MessageException { PDU responsePDU = (PDU) event.getPDU().clone(); responsePDU.setType(PDU.RESPONSE); responsePDU.setErrorStatus(PDU.noError); responsePDU.setErrorIndex(0); messageDispatcher.returnResponsePdu(event.getMessageProcessingModel(), event.getSecurityModel(), event.getSecurityName(), event.getSecurityLevel(), responsePDU, event.getMaxSizeResponsePDU(), event.getStateReference(), new StatusInformation()); } }
@Override public void processPdu(CommandResponderEvent e) { PDU command = e.getPDU(); if (command == null) return; PDU response = processRequest(command); if (response == null) return; StatusInformation statusInformation = new StatusInformation(); StateReference ref = e.getStateReference(); try { LOG.debug("Replying with: {}", command); e.setProcessed(true); e.getMessageDispatcher().returnResponsePdu(e.getMessageProcessingModel(), e.getSecurityModel(), e.getSecurityName(), e.getSecurityLevel(), command, e.getMaxSizeResponsePDU(), ref, statusInformation); } catch (MessageException ex) { LOG.error("Error while sending response", ex); } }
try { e.getMessageDispatcher().returnResponsePdu(e.getMessageProcessingModel(), e.getSecurityModel(), e.getSecurityName(), e.getSecurityLevel(),
protected boolean matchParameters(ProxyForwardRequest request, OctetString paramIn) { MOTableRow param2Match = targetMIB.getTargetParamsRow(paramIn, true); if (param2Match != null) { int mpModel = param2Match.getValue( SnmpTargetMIB.idxSnmpTargetParamsMPModel).toInt(); int secModel = param2Match.getValue( SnmpTargetMIB.idxSnmpTargetParamsSecurityModel).toInt(); int secLevel = param2Match.getValue( SnmpTargetMIB.idxSnmpTargetParamsSecurityLevel).toInt(); OctetString secName = (OctetString) param2Match.getValue( SnmpTargetMIB.idxSnmpTargetParamsSecurityName); if (logger.isDebugEnabled()) { logger.debug("Matching request " + request + " with mpModel=" + mpModel + ", secModel=" + secModel + ", secLevel=" + secLevel + ", secName=" + secName); } if ((mpModel == request.getCommandEvent().getMessageProcessingModel()) && (secName.equals(request.getSecurityName())) && ((secModel == 0) || (secModel == request.getCommandEvent().getSecurityModel())) && (secLevel == request.getCommandEvent().getSecurityLevel())) { return true; } } return false; }
protected boolean matchParameters(ProxyForwardRequest request, OctetString paramIn) { MOTableRow param2Match = targetMIB.getTargetParamsRow(paramIn, true); if (param2Match != null) { int mpModel = param2Match.getValue( SnmpTargetMIB.idxSnmpTargetParamsMPModel).toInt(); int secModel = param2Match.getValue( SnmpTargetMIB.idxSnmpTargetParamsSecurityModel).toInt(); int secLevel = param2Match.getValue( SnmpTargetMIB.idxSnmpTargetParamsSecurityLevel).toInt(); OctetString secName = (OctetString) param2Match.getValue( SnmpTargetMIB.idxSnmpTargetParamsSecurityName); if (logger.isDebugEnabled()) { logger.debug("Matching request "+request+" with mpModel="+mpModel+ ", secModel="+secModel+", secLevel="+secLevel+ ", secName="+secName); } if ((mpModel == request.getCommandEvent().getMessageProcessingModel()) && (secName.equals(request.getSecurityName())) && ((secModel == 0) || (secModel == request.getCommandEvent().getSecurityModel())) && (secLevel == request.getCommandEvent().getSecurityLevel())) { return true; } } return false; }
if (e.getSecurityModel() != request.target.getSecurityModel()) { logger.warn("RFC3412 §7.2.11.b: Received REPORT PDU with different security model than cached one: " + e); return null;
if (e.getSecurityModel() != request.target.getSecurityModel()) { logger.warn("RFC3412 §7.2.11.b: Received REPORT PDU with different security model than cached one: "+e); return null;
stateRef.setTransportMapping(requestEvent.getTransportMapping()); disp.returnResponsePdu(requestEvent.getMessageProcessingModel(), requestEvent.getSecurityModel(), requestEvent.getSecurityName(), requestEvent.getSecurityLevel(),