PDUv1 pdu1 = new PDUv1(); transMap.listen();
protected Snmp4JV1TrapBuilder(Snmp4JStrategy strategy) { super(strategy, new PDUv1(), PDUv1.V1TRAP); }
public Object clone() { return new PDUv1(this); }
public Object clone() { return new PDUv1(this); }
protected Snmp4JV1TrapBuilder(Snmp4JStrategy strategy) { super(strategy, new PDUv1(), PDUv1.V1TRAP); }
public Object clone() { return new PDUv1(this); }
protected Snmp4JV1TrapBuilder(Snmp4JStrategy strategy) { super(strategy, new PDUv1(), PDUv1.V1TRAP); }
/** * Creates a <code>PDU</code> instance for the specified SNMP version. * @param targetVersion * a SNMP version as defined by {@link SnmpConstants}. * @return * a PDU instance that is compatible with the supplied target SNMP version. * @since 1.7.3 */ public static PDU createPDU(int targetVersion) { PDU request; switch (targetVersion) { case SnmpConstants.version3: { request = new ScopedPDU(); break; } case SnmpConstants.version1: { request = new PDUv1(); break; } default: request = new PDU(); } return request; }
/** * Creates a <code>PDU</code> instance for the specified SNMP version. * @param targetVersion * a SNMP version as defined by {@link SnmpConstants}. * @return * a PDU instance that is compatible with the supplied target SNMP version. * @since 1.7.3 */ public static PDU createPDU(int targetVersion) { PDU request; switch (targetVersion) { case SnmpConstants.version3: { request = new ScopedPDU(); break; } case SnmpConstants.version1: { request = new PDUv1(); break; } default: request = new PDU(); } return request; }
/** * Create a <code>PDU</code> instance for the specified SNMP version. * @param targetVersion * a SNMP version as defined by {@link SnmpConstants}. * @return * a PDU instance that is compatible with the supplied target SNMP version. * @since 1.7.3 */ public static PDU createPDU(int targetVersion) { PDU request; switch (targetVersion) { case SnmpConstants.version3: { request = new ScopedPDU(); break; } case SnmpConstants.version1: { request = new PDUv1(); break; } default: request = new PDU(); } return request; } }
private static PDU createPduByMP(MessageProcessingModel messageProcessingModel) { PDU pdu; switch (messageProcessingModel.getID()) { case MessageProcessingModel.MPv3: { pdu = new ScopedPDU(); break; } case MessageProcessingModel.MPv1: { pdu = new PDUv1(); break; } default: pdu = new PDU(); } return pdu; }
private static PDU createPduByMP(MessageProcessingModel messageProcessingModel) { PDU pdu; switch (messageProcessingModel.getID()) { case MessageProcessingModel.MPv3: { pdu = new ScopedPDU(); break; } case MessageProcessingModel.MPv1: { pdu = new PDUv1(); break; } default: pdu = new PDU(); } return pdu; }
/** * Create and initialize an SNMP v1 trap PDU. * * @param genericTrap * The generic trap number * @param specificTrap * The specific trap value from your MIB definition * @param enterpriseOid * The IANA enterprise OID to use. * @param timeTicks * The time ticks value as a long * @return The initialized v1 trap PDU ready to have the variable bindings * added */ public PDUv1 createTrapV1(int genericTrap, int specificTrap, String enterpriseOid, long timeTicks) { if (genericTrap < PDUv1.COLDSTART || genericTrap > PDUv1.ENTERPRISE_SPECIFIC) { throw new IllegalArgumentException("The genericTrap must be >= 0 and <= 6"); } PDUv1 pdu= new PDUv1(); pdu.setType(PDU.V1TRAP); pdu.setAgentAddress(address); pdu.setEnterprise(new OID(enterpriseOid)); pdu.setGenericTrap(genericTrap); pdu.setSpecificTrap(specificTrap); pdu.setTimestamp(timeTicks); return pdu; }
PDUv1 pdu = new PDUv1(); pdu.setType(PDU.V1TRAP); pdu.setEnterprise(new OID(trapOid));
target.setVersion(SnmpConstants.version2c); PDUv1 pdu = new PDUv1(); pdu.setType(PDU.TRAP);
PDUv1 trapPdu = new PDUv1();
PDUv1 trapPdu = new PDUv1();
public void testGetSysName() throws IOException { Snmp snmp = new Snmp(new DefaultUdpTransportMapping()); snmp.listen(); Address addr = new UdpAddress(InetAddress.getLocalHost(), 9161); //Address addr = new UdpAddress(InetAddressUtils.addr("192.168.0.100"), 161); Target target = new CommunityTarget(addr, new OctetString("public")); target.setVersion(SnmpConstants.version1); target.setTimeout(3000); target.setRetries(3); PDUv1 getRequest = new PDUv1(); getRequest.add(new VariableBinding(new OID("1.3.6.1.2.1.1.5.0"))); ResponseEvent e = snmp.get(getRequest, target); PDU response = e.getResponse(); assertEquals(new OctetString("mockhost"), response.get(0).getVariable()); }
case MessageProcessingModel.MPv1: { t = new CommunityTarget(address, community); PDUv1 trap = new PDUv1(); pdu = trap; if (sysUpTime != null) {
case MessageProcessingModel.MPv1: { t = new CommunityTarget(address, community); PDUv1 trap = new PDUv1(); pdu = trap; if (sysUpTime != null) {