public Address getBindAddress(Map<String,List<Object>> settings) { String addr = (String) ArgumentParser.getValue(settings, oBindAddress, 0); if (addr != null) { if (addr.indexOf('/') <= 0) { addr += "/0"; } return GenericAddress.parse(addr); } return null; }
/** * Parse an address form the supplied string. * @param address * an address string known by the GenericAddress. * @return boolean * @see #parse(String address) */ public boolean parseAddress(String address) { Address addr = parse(address); if (addr instanceof SMIAddress) { setAddress((SMIAddress)addr); return true; } return false; }
/** * Parse an address form the supplied string. * @param address * an address string known by the GenericAddress. * @return boolean * @see #parse(String address) */ public boolean parseAddress(String address) { Address addr = parse(address); if (addr instanceof SMIAddress) { setAddress((SMIAddress)addr); return true; } return false; }
/** * Parse an address form the supplied string. * @param address * an address string known by the GenericAddress. * @return boolean * @see #parse(String address) */ public boolean parseAddress(String address) { Address addr = parse(address); if (addr instanceof SMIAddress) { setAddress((SMIAddress)addr); return true; } return false; }
protected void initTransportMappings() throws IOException { transportMappings = new TransportMapping<?>[1]; Address addr = GenericAddress.parse(address); TransportMapping<? extends Address> tm = TransportMappings.getInstance().createTransportMapping(addr); transportMappings[0] = tm; }
protected void initTransportMappings() throws IOException { transportMappings = new TransportMapping[1]; Address addr = GenericAddress.parse(address); TransportMapping tm = TransportMappings.getInstance().createTransportMapping(addr); transportMappings[0] = tm; }
protected void initTransportMappings() throws IOException { transportMappings = new TransportMapping[1]; Address addr = GenericAddress.parse(address); TransportMapping tm = TransportMappings.getInstance().createTransportMapping(addr); transportMappings[0] = tm; }
protected void initTransportMappings() throws IOException { transportMappings = new TransportMapping[1]; Address addr = GenericAddress.parse(address); TransportMapping tm = TransportMappings.getInstance().createTransportMapping(addr); transportMappings[0] = tm; }
@Override protected void initTransportMappings() throws IOException { String host = getProperty(SNMPConstants.SNMP_HOST, SNMPConstants.SNMP_DEFAULT_HOST); int port = Integer.parseInt(getProperty(SNMPConstants.SNMP_PORT, String.valueOf(SNMPConstants.SNMP_DEFAULT_PORT))); String address = host + "/" + port; Address adr = GenericAddress.parse(address); TransportMapping tm = TransportMappings.getInstance().createTransportMapping(adr); transportMappings = new TransportMapping[] { tm }; log.info("SNMP transport adapter initialized on udp:" + address); }
protected void initTransportMappings() throws IOException { transportMappings = new TransportMapping<?>[1]; Address addr = GenericAddress.parse(address); TransportMapping<?> tm = TransportMappings.getInstance().createTransportMapping(addr); transportMappings[0] = tm; }
@Override protected void initTransportMappings() throws IOException { transportMappings = new TransportMapping[1]; Address addr = GenericAddress.parse(address); TransportMapping tm = TransportMappings.getInstance().createTransportMapping(addr); transportMappings[0] = tm; }
protected void initTransportMappings() throws IOException { transportMappings = new TransportMapping[1]; Address addr = GenericAddress.parse(address); TransportMapping tm = TransportMappings.getInstance() .createTransportMapping(addr); transportMappings[0] = tm; }
@Override protected void initTransportMappings() throws IOException { String host = getProperty(SNMPConstants.SNMP_HOST, SNMPConstants.SNMP_DEFAULT_HOST); int port = Integer.parseInt(getProperty(SNMPConstants.SNMP_PORT, String.valueOf(SNMPConstants.SNMP_DEFAULT_PORT))); String address = host + "/" + port; Address adr = GenericAddress.parse(address); TransportMapping tm = TransportMappings.getInstance().createTransportMapping(adr); transportMappings = new TransportMapping[] { tm }; log.info("SNMP transport adapter initialized on udp:" + address); }
private Target getTarget(String communityString) { if(version == V1 || version == V2C) { Address address = GenericAddress.parse("udp:" + ip + "/" + port); CommunityTarget target = new CommunityTarget(address, new OctetString(communityString)); target.setVersion(version); return target; } throw new RuntimeException("Snmpv3 is not supported"); } }
@Override public synchronized void activate() throws Exception { super.activate(); // load connection data only if the endpoint is enabled if (isEnabled()) { logger.debug("Activating endpoint"); this.listenGenericAddress = GenericAddress.parse(this.address); this.transport = new DefaultUdpTransportMapping((UdpAddress) this.listenGenericAddress); this.snmp = new Snmp(transport); snmp.addCommandResponder(this); } }
private Target getTarget() { Address targetAddress = GenericAddress.parse(address); CommunityTarget target = new CommunityTarget(); target.setCommunity(new OctetString("public")); target.setAddress(targetAddress); target.setRetries(2); target.setTimeout(1500); target.setVersion(SnmpConstants.version2c); return target; } }
private Target getTarget() { Address targetAddress = GenericAddress.parse(address); CommunityTarget target = new CommunityTarget(); target.setCommunity(new OctetString("public")); target.setAddress(targetAddress); target.setRetries(2); target.setTimeout(1500); target.setVersion(SnmpConstants.version2c); return target; }
public void start () throws IOException { this.address = GenericAddress.parse ( this.connectionInformation.getAddress () ); this.transport = new DefaultUdpTransportMapping (); this.snmp = new Snmp ( this.transport ); //MPv3 mpv3 = (MPv3)_snmp.getMessageProcessingModel ( MessageProcessingModel.MPv3 ); final USM usm = new USM ( SecurityProtocols.getInstance (), new OctetString ( MPv3.createLocalEngineID () ), 0 ); SecurityModels.getInstance ().addSecurityModel ( usm ); this.snmp.listen (); }
@Override protected void doStart() throws Exception { super.doStart(); this.targetAddress = GenericAddress.parse(this.endpoint.getAddress()); LOG.debug("targetAddress: {}", targetAddress); this.usm = new USM(SecurityProtocols.getInstance(), new OctetString(MPv3.createLocalEngineID()), 0); SecurityModels.getInstance().addSecurityModel(this.usm); // setting up target this.target = new CommunityTarget(); this.target.setCommunity(new OctetString(endpoint.getSnmpCommunity())); this.target.setAddress(this.targetAddress); this.target.setRetries(this.endpoint.getRetries()); this.target.setTimeout(this.endpoint.getTimeout()); this.target.setVersion(this.endpoint.getSnmpVersion()); }
@Override public synchronized void activate() throws Exception { super.activate(); this.targetAddress = GenericAddress.parse(this.address); this.transport = new DefaultUdpTransportMapping(); this.snmp = new Snmp(transport); this.usm = new USM(SecurityProtocols.getInstance(), new OctetString(MPv3.createLocalEngineID()), 0); SecurityModels.getInstance().addSecurityModel(usm); // setting up target target = new CommunityTarget(); target.setCommunity(new OctetString(this.snmpCommunity)); target.setAddress(targetAddress); target.setRetries(this.retries); target.setTimeout(this.timeout); target.setVersion(this.snmpVersion); // creating PDU this.pdu = new PDU(); }