Examples of SnmpPduPacket


Examples of com.sun.jmx.snmp.SnmpPduPacket

                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpResponseHandler.class.getName(),
                        "processDatagram", "Dropping packet. Unable to find the pdu factory of the SNMP adaptor server");
                }
            }
            else {
                SnmpPduPacket snmpProt = (SnmpPduPacket)pduFactory.decodeSnmpPdu(msg);

                if (snmpProt == null) {
                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
                        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpResponseHandler.class.getName(),
                            "processDatagram", "Dropping packet. Pdu factory returned a null value");
View Full Code Here

Examples of com.sun.jmx.snmp.SnmpPduPacket

    private SnmpMessage makeResponseMessage(SnmpMessage reqMsg) {
        SnmpMessage respMsg = null ;

        // Transform the request message into a request pdu
        //
        SnmpPduPacket reqPdu;
        Object userData = null;
        try {
            reqPdu = (SnmpPduPacket)pduFactory.decodeSnmpPdu(reqMsg) ;
            if (reqPdu != null && userDataFactory != null)
                userData = userDataFactory.allocateUserData(reqPdu);
        }
        catch(SnmpStatusException x) {
            reqPdu = null ;
            SnmpAdaptorServer snmpServer = (SnmpAdaptorServer)adaptorServer ;
            snmpServer.incSnmpInASNParseErrs(1) ;
            if (x.getStatus()== SnmpDefinitions.snmpWrongSnmpVersion)
                snmpServer.incSnmpInBadVersions(1) ;
            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
                    "makeResponseMessage", "message decoding failed", x);
            }
        }

        // Make the response pdu if any
        //
        SnmpPduPacket respPdu = null ;
        if (reqPdu != null) {
            respPdu = makeResponsePdu(reqPdu,userData) ;
            try {
                if (userDataFactory != null)
                    userDataFactory.releaseUserData(userData,respPdu);
View Full Code Here

Examples of com.sun.jmx.snmp.SnmpPduPacket

     */
    private SnmpPduPacket makeResponsePdu(SnmpPduPacket reqPdu,
                                          Object userData) {

        SnmpAdaptorServer snmpServer = (SnmpAdaptorServer)adaptorServer ;
        SnmpPduPacket respPdu = null ;

        snmpServer.updateRequestCounters(reqPdu.type) ;
        if (reqPdu.varBindList != null)
            snmpServer.updateVarCounters(reqPdu.type,
                                         reqPdu.varBindList.length) ;
View Full Code Here

Examples of com.sun.jmx.snmp.SnmpPduPacket


        // Execute all the subrequests resulting from the split of the
        // varbind list.
        //
        SnmpPduPacket result= executeSubRequest(req,userData);
        if (result != null)
            // It means that an error occurred. The error is already
            // formatted by the executeSubRequest
            // method.
            return result;
View Full Code Here

Examples of com.sun.jmx.snmp.SnmpPduPacket

        }

        // Split the request into subrequests.
        //
        splitBulkRequest(req, N, M, R);
        SnmpPduPacket result= executeSubRequest(req,userData);
        if (result != null)
            return result;

        respVarBindList= mergeBulkResponses(N + (M * R));

 
View Full Code Here

Examples of com.sun.jmx.snmp.SnmpPduPacket

     * Check if the specified pdu is conform to the ACL.
     * This method returns null if the pdu is ok. If not, it returns
     * the response pdu to be replied.
     */
    private SnmpPduPacket checkAcl(SnmpPduPacket pdu) {
        SnmpPduPacket response = null ;
        String community = new String(pdu.community) ;

        // We check the pdu type and create an error response if
        // the check failed.
        //
View Full Code Here

Examples of com.sun.jmx.snmp.SnmpPduPacket

    }

    private SnmpMessage newTooBigMessage(SnmpMessage reqMsg)
        throws SnmpTooBigException {
        SnmpMessage result = null ;
        SnmpPduPacket reqPdu;

        try {
            reqPdu = (SnmpPduPacket)pduFactory.decodeSnmpPdu(reqMsg) ;
            if (reqPdu != null) {
                SnmpPduPacket respPdu = newTooBigPdu(reqPdu) ;
                result = (SnmpMessage)pduFactory.
                    encodeSnmpPdu(respPdu, packet.getData().length) ;
            }
        }
        catch(SnmpStatusException x) {
View Full Code Here

Examples of com.sun.jmx.snmp.SnmpPduPacket

   
    /**
     * Constructs an inform request PDU.
     */
    synchronized SnmpPdu constructPduPacket() { 
        SnmpPduPacket reqpdu = null;
        Exception excep = null;
        try {
            reqpdu = new SnmpPduRequest();
            reqpdu.port = port;
            reqpdu.type = pduInformRequestPdu;
View Full Code Here

Examples of com.sun.jmx.snmp.SnmpPduPacket

                if (isDebugOn()) {
                    debug("processDatagram", "Dropping packet. Unable to find the pdu factory of the SNMP adaptor server");
                }
            }
            else {
                SnmpPduPacket snmpProt = (SnmpPduPacket)pduFactory.decodeSnmpPdu(msg);
               
                if (snmpProt == null) {
                    if (isDebugOn()) {
                        debug("processDatagram", "Dropping packet. Pdu factory returned a null value");
                    }
View Full Code Here

Examples of com.sun.jmx.snmp.SnmpPduPacket

    /**
     * Constructs an inform request PDU.
     */
    synchronized SnmpPdu constructPduPacket() {
        SnmpPduPacket reqpdu = null;
        Exception excep = null;
        try {
            reqpdu = new SnmpPduRequest();
            reqpdu.port = port;
            reqpdu.type = pduInformRequestPdu;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.