com.sun.jmx.snmp.SnmpDataTypeEnums Java Examples

The following examples show how to use com.sun.jmx.snmp.SnmpDataTypeEnums. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SnmpRequestHandler.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example #2
Source File: SnmpRequestHandler.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example #3
Source File: SnmpRequestHandler.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example #4
Source File: SnmpRequestHandler.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example #5
Source File: SnmpRequestHandler.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example #6
Source File: SnmpRequestHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example #7
Source File: SnmpRequestHandler.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example #8
Source File: SnmpRequestHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example #9
Source File: SnmpRequestHandler.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example #10
Source File: SnmpRequestHandler.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example #11
Source File: SnmpRequestHandler.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example #12
Source File: SnmpRequestHandler.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example #13
Source File: SnmpRequestHandler.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example #14
Source File: SnmpRequestHandler.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example #15
Source File: SnmpRequestHandler.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
SnmpPduPacket makeNoMibErrorPdu(SnmpPduRequest req, Object userData) {
    // There is no agent registered
    //
    if (req.version == SnmpDefinitions.snmpVersionOne) {
        // Version 1: => NoSuchName
        return
            newErrorResponsePdu(req,snmpRspNoSuchName,1);
    } else if (req.version == SnmpDefinitions.snmpVersionTwo) {
        // Version 2: => depends on PDU type
        switch (req.type) {
        case pduSetRequestPdu :
        case pduWalkRequest :
            // SET request => NoAccess
            return
                newErrorResponsePdu(req,snmpRspNoAccess,1);
        case pduGetRequestPdu :
            // GET request => NoSuchObject
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errNoSuchObjectTag);
        case pduGetNextRequestPdu :
        case pduGetBulkRequestPdu :
            // GET-NEXT or GET-BULK => EndOfMibView
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errEndOfMibViewTag);
        default:
        }
    }
    // Something wrong here: => snmpRspGenErr
    return newErrorResponsePdu(req,snmpRspGenErr,1);
}
 
Example #16
Source File: SnmpRequestHandler.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
SnmpPduPacket makeNoMibErrorPdu(SnmpPduRequest req, Object userData) {
    // There is no agent registered
    //
    if (req.version == SnmpDefinitions.snmpVersionOne) {
        // Version 1: => NoSuchName
        return
            newErrorResponsePdu(req,snmpRspNoSuchName,1);
    } else if (req.version == SnmpDefinitions.snmpVersionTwo) {
        // Version 2: => depends on PDU type
        switch (req.type) {
        case pduSetRequestPdu :
        case pduWalkRequest :
            // SET request => NoAccess
            return
                newErrorResponsePdu(req,snmpRspNoAccess,1);
        case pduGetRequestPdu :
            // GET request => NoSuchObject
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errNoSuchObjectTag);
        case pduGetNextRequestPdu :
        case pduGetBulkRequestPdu :
            // GET-NEXT or GET-BULK => EndOfMibView
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errEndOfMibViewTag);
        default:
        }
    }
    // Something wrong here: => snmpRspGenErr
    return newErrorResponsePdu(req,snmpRspGenErr,1);
}
 
Example #17
Source File: SnmpRequestHandler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
SnmpPduPacket makeNoMibErrorPdu(SnmpPduRequest req, Object userData) {
    // There is no agent registered
    //
    if (req.version == SnmpDefinitions.snmpVersionOne) {
        // Version 1: => NoSuchName
        return
            newErrorResponsePdu(req,snmpRspNoSuchName,1);
    } else if (req.version == SnmpDefinitions.snmpVersionTwo) {
        // Version 2: => depends on PDU type
        switch (req.type) {
        case pduSetRequestPdu :
        case pduWalkRequest :
            // SET request => NoAccess
            return
                newErrorResponsePdu(req,snmpRspNoAccess,1);
        case pduGetRequestPdu :
            // GET request => NoSuchObject
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errNoSuchObjectTag);
        case pduGetNextRequestPdu :
        case pduGetBulkRequestPdu :
            // GET-NEXT or GET-BULK => EndOfMibView
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errEndOfMibViewTag);
        default:
        }
    }
    // Something wrong here: => snmpRspGenErr
    return newErrorResponsePdu(req,snmpRspGenErr,1);
}
 
Example #18
Source File: SnmpRequestHandler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
SnmpPduPacket makeNoMibErrorPdu(SnmpPduRequest req, Object userData) {
    // There is no agent registered
    //
    if (req.version == SnmpDefinitions.snmpVersionOne) {
        // Version 1: => NoSuchName
        return
            newErrorResponsePdu(req,snmpRspNoSuchName,1);
    } else if (req.version == SnmpDefinitions.snmpVersionTwo) {
        // Version 2: => depends on PDU type
        switch (req.type) {
        case pduSetRequestPdu :
        case pduWalkRequest :
            // SET request => NoAccess
            return
                newErrorResponsePdu(req,snmpRspNoAccess,1);
        case pduGetRequestPdu :
            // GET request => NoSuchObject
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errNoSuchObjectTag);
        case pduGetNextRequestPdu :
        case pduGetBulkRequestPdu :
            // GET-NEXT or GET-BULK => EndOfMibView
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errEndOfMibViewTag);
        default:
        }
    }
    // Something wrong here: => snmpRspGenErr
    return newErrorResponsePdu(req,snmpRspGenErr,1);
}
 
Example #19
Source File: SnmpRequestHandler.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
SnmpPduPacket makeNoMibErrorPdu(SnmpPduRequest req, Object userData) {
    // There is no agent registered
    //
    if (req.version == SnmpDefinitions.snmpVersionOne) {
        // Version 1: => NoSuchName
        return
            newErrorResponsePdu(req,snmpRspNoSuchName,1);
    } else if (req.version == SnmpDefinitions.snmpVersionTwo) {
        // Version 2: => depends on PDU type
        switch (req.type) {
        case pduSetRequestPdu :
        case pduWalkRequest :
            // SET request => NoAccess
            return
                newErrorResponsePdu(req,snmpRspNoAccess,1);
        case pduGetRequestPdu :
            // GET request => NoSuchObject
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errNoSuchObjectTag);
        case pduGetNextRequestPdu :
        case pduGetBulkRequestPdu :
            // GET-NEXT or GET-BULK => EndOfMibView
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errEndOfMibViewTag);
        default:
        }
    }
    // Something wrong here: => snmpRspGenErr
    return newErrorResponsePdu(req,snmpRspGenErr,1);
}
 
Example #20
Source File: SnmpRequestHandler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
SnmpPduPacket makeNoMibErrorPdu(SnmpPduRequest req, Object userData) {
    // There is no agent registered
    //
    if (req.version == SnmpDefinitions.snmpVersionOne) {
        // Version 1: => NoSuchName
        return
            newErrorResponsePdu(req,snmpRspNoSuchName,1);
    } else if (req.version == SnmpDefinitions.snmpVersionTwo) {
        // Version 2: => depends on PDU type
        switch (req.type) {
        case pduSetRequestPdu :
        case pduWalkRequest :
            // SET request => NoAccess
            return
                newErrorResponsePdu(req,snmpRspNoAccess,1);
        case pduGetRequestPdu :
            // GET request => NoSuchObject
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errNoSuchObjectTag);
        case pduGetNextRequestPdu :
        case pduGetBulkRequestPdu :
            // GET-NEXT or GET-BULK => EndOfMibView
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errEndOfMibViewTag);
        default:
        }
    }
    // Something wrong here: => snmpRspGenErr
    return newErrorResponsePdu(req,snmpRspGenErr,1);
}
 
Example #21
Source File: SnmpRequestHandler.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
SnmpPduPacket makeNoMibErrorPdu(SnmpPduRequest req, Object userData) {
    // There is no agent registered
    //
    if (req.version == SnmpDefinitions.snmpVersionOne) {
        // Version 1: => NoSuchName
        return
            newErrorResponsePdu(req,snmpRspNoSuchName,1);
    } else if (req.version == SnmpDefinitions.snmpVersionTwo) {
        // Version 2: => depends on PDU type
        switch (req.type) {
        case pduSetRequestPdu :
        case pduWalkRequest :
            // SET request => NoAccess
            return
                newErrorResponsePdu(req,snmpRspNoAccess,1);
        case pduGetRequestPdu :
            // GET request => NoSuchObject
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errNoSuchObjectTag);
        case pduGetNextRequestPdu :
        case pduGetBulkRequestPdu :
            // GET-NEXT or GET-BULK => EndOfMibView
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errEndOfMibViewTag);
        default:
        }
    }
    // Something wrong here: => snmpRspGenErr
    return newErrorResponsePdu(req,snmpRspGenErr,1);
}
 
Example #22
Source File: SnmpRequestHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
SnmpPduPacket makeNoMibErrorPdu(SnmpPduRequest req, Object userData) {
    // There is no agent registered
    //
    if (req.version == SnmpDefinitions.snmpVersionOne) {
        // Version 1: => NoSuchName
        return
            newErrorResponsePdu(req,snmpRspNoSuchName,1);
    } else if (req.version == SnmpDefinitions.snmpVersionTwo) {
        // Version 2: => depends on PDU type
        switch (req.type) {
        case pduSetRequestPdu :
        case pduWalkRequest :
            // SET request => NoAccess
            return
                newErrorResponsePdu(req,snmpRspNoAccess,1);
        case pduGetRequestPdu :
            // GET request => NoSuchObject
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errNoSuchObjectTag);
        case pduGetNextRequestPdu :
        case pduGetBulkRequestPdu :
            // GET-NEXT or GET-BULK => EndOfMibView
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errEndOfMibViewTag);
        default:
        }
    }
    // Something wrong here: => snmpRspGenErr
    return newErrorResponsePdu(req,snmpRspGenErr,1);
}
 
Example #23
Source File: SnmpRequestHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
SnmpPduPacket makeNoMibErrorPdu(SnmpPduRequest req, Object userData) {
    // There is no agent registered
    //
    if (req.version == SnmpDefinitions.snmpVersionOne) {
        // Version 1: => NoSuchName
        return
            newErrorResponsePdu(req,snmpRspNoSuchName,1);
    } else if (req.version == SnmpDefinitions.snmpVersionTwo) {
        // Version 2: => depends on PDU type
        switch (req.type) {
        case pduSetRequestPdu :
        case pduWalkRequest :
            // SET request => NoAccess
            return
                newErrorResponsePdu(req,snmpRspNoAccess,1);
        case pduGetRequestPdu :
            // GET request => NoSuchObject
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errNoSuchObjectTag);
        case pduGetNextRequestPdu :
        case pduGetBulkRequestPdu :
            // GET-NEXT or GET-BULK => EndOfMibView
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errEndOfMibViewTag);
        default:
        }
    }
    // Something wrong here: => snmpRspGenErr
    return newErrorResponsePdu(req,snmpRspGenErr,1);
}
 
Example #24
Source File: SnmpRequestHandler.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
SnmpPduPacket makeNoMibErrorPdu(SnmpPduRequest req, Object userData) {
    // There is no agent registered
    //
    if (req.version == SnmpDefinitions.snmpVersionOne) {
        // Version 1: => NoSuchName
        return
            newErrorResponsePdu(req,snmpRspNoSuchName,1);
    } else if (req.version == SnmpDefinitions.snmpVersionTwo) {
        // Version 2: => depends on PDU type
        switch (req.type) {
        case pduSetRequestPdu :
        case pduWalkRequest :
            // SET request => NoAccess
            return
                newErrorResponsePdu(req,snmpRspNoAccess,1);
        case pduGetRequestPdu :
            // GET request => NoSuchObject
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errNoSuchObjectTag);
        case pduGetNextRequestPdu :
        case pduGetBulkRequestPdu :
            // GET-NEXT or GET-BULK => EndOfMibView
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errEndOfMibViewTag);
        default:
        }
    }
    // Something wrong here: => snmpRspGenErr
    return newErrorResponsePdu(req,snmpRspGenErr,1);
}
 
Example #25
Source File: SnmpRequestHandler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
SnmpPduPacket makeNoMibErrorPdu(SnmpPduRequest req, Object userData) {
    // There is no agent registered
    //
    if (req.version == SnmpDefinitions.snmpVersionOne) {
        // Version 1: => NoSuchName
        return
            newErrorResponsePdu(req,snmpRspNoSuchName,1);
    } else if (req.version == SnmpDefinitions.snmpVersionTwo) {
        // Version 2: => depends on PDU type
        switch (req.type) {
        case pduSetRequestPdu :
        case pduWalkRequest :
            // SET request => NoAccess
            return
                newErrorResponsePdu(req,snmpRspNoAccess,1);
        case pduGetRequestPdu :
            // GET request => NoSuchObject
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errNoSuchObjectTag);
        case pduGetNextRequestPdu :
        case pduGetBulkRequestPdu :
            // GET-NEXT or GET-BULK => EndOfMibView
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errEndOfMibViewTag);
        default:
        }
    }
    // Something wrong here: => snmpRspGenErr
    return newErrorResponsePdu(req,snmpRspGenErr,1);
}
 
Example #26
Source File: SnmpRequestHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
SnmpPduPacket makeNoMibErrorPdu(SnmpPduRequest req, Object userData) {
    // There is no agent registered
    //
    if (req.version == SnmpDefinitions.snmpVersionOne) {
        // Version 1: => NoSuchName
        return
            newErrorResponsePdu(req,snmpRspNoSuchName,1);
    } else if (req.version == SnmpDefinitions.snmpVersionTwo) {
        // Version 2: => depends on PDU type
        switch (req.type) {
        case pduSetRequestPdu :
        case pduWalkRequest :
            // SET request => NoAccess
            return
                newErrorResponsePdu(req,snmpRspNoAccess,1);
        case pduGetRequestPdu :
            // GET request => NoSuchObject
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errNoSuchObjectTag);
        case pduGetNextRequestPdu :
        case pduGetBulkRequestPdu :
            // GET-NEXT or GET-BULK => EndOfMibView
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errEndOfMibViewTag);
        default:
        }
    }
    // Something wrong here: => snmpRspGenErr
    return newErrorResponsePdu(req,snmpRspGenErr,1);
}
 
Example #27
Source File: SnmpRequestHandler.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
SnmpPduPacket makeNoMibErrorPdu(SnmpPduRequest req, Object userData) {
    // There is no agent registered
    //
    if (req.version == SnmpDefinitions.snmpVersionOne) {
        // Version 1: => NoSuchName
        return
            newErrorResponsePdu(req,snmpRspNoSuchName,1);
    } else if (req.version == SnmpDefinitions.snmpVersionTwo) {
        // Version 2: => depends on PDU type
        switch (req.type) {
        case pduSetRequestPdu :
        case pduWalkRequest :
            // SET request => NoAccess
            return
                newErrorResponsePdu(req,snmpRspNoAccess,1);
        case pduGetRequestPdu :
            // GET request => NoSuchObject
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errNoSuchObjectTag);
        case pduGetNextRequestPdu :
        case pduGetBulkRequestPdu :
            // GET-NEXT or GET-BULK => EndOfMibView
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errEndOfMibViewTag);
        default:
        }
    }
    // Something wrong here: => snmpRspGenErr
    return newErrorResponsePdu(req,snmpRspGenErr,1);
}
 
Example #28
Source File: SnmpRequestHandler.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
SnmpPduPacket makeNoMibErrorPdu(SnmpPduRequest req, Object userData) {
    // There is no agent registered
    //
    if (req.version == SnmpDefinitions.snmpVersionOne) {
        // Version 1: => NoSuchName
        return
            newErrorResponsePdu(req,snmpRspNoSuchName,1);
    } else if (req.version == SnmpDefinitions.snmpVersionTwo) {
        // Version 2: => depends on PDU type
        switch (req.type) {
        case pduSetRequestPdu :
        case pduWalkRequest :
            // SET request => NoAccess
            return
                newErrorResponsePdu(req,snmpRspNoAccess,1);
        case pduGetRequestPdu :
            // GET request => NoSuchObject
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errNoSuchObjectTag);
        case pduGetNextRequestPdu :
        case pduGetBulkRequestPdu :
            // GET-NEXT or GET-BULK => EndOfMibView
            return
                makeErrorVarbindPdu(req,SnmpDataTypeEnums.
                                    errEndOfMibViewTag);
        default:
        }
    }
    // Something wrong here: => snmpRspGenErr
    return newErrorResponsePdu(req,snmpRspGenErr,1);
}