Package org.snmp4j.transport

Examples of org.snmp4j.transport.DefaultUdpTransportMapping$ListenThread


        // either tcp or udp
        if ("tcp".equals(endpoint.getProtocol())) {
            this.transport = new DefaultTcpTransportMapping((TcpAddress)this.listenGenericAddress);
        } else if ("udp".equals(endpoint.getProtocol())) {
            this.transport = new DefaultUdpTransportMapping((UdpAddress)this.listenGenericAddress);
        } else {
            throw new IllegalArgumentException("Unknown protocol: " + endpoint.getProtocol());
        }

        this.snmp = new Snmp(transport);
View Full Code Here


        // either tcp or udp
        if ("tcp".equals(endpoint.getProtocol())) {
            this.transport = new DefaultTcpTransportMapping();
        } else if ("udp".equals(endpoint.getProtocol())) {
            this.transport = new DefaultUdpTransportMapping();
        } else {
            throw new IllegalArgumentException("Unknown protocol: " + endpoint.getProtocol());
        }

        this.snmp = new Snmp(this.transport);
View Full Code Here

        // either tcp or udp
        if ("tcp".equals(endpoint.getProtocol())) {
            this.transport = new DefaultTcpTransportMapping((TcpAddress)this.listenGenericAddress);
        } else if ("udp".equals(endpoint.getProtocol())) {
            this.transport = new DefaultUdpTransportMapping((UdpAddress)this.listenGenericAddress);
        } else {
            throw new IllegalArgumentException("Unknown protocol: " + endpoint.getProtocol());
        }

        this.snmp = new Snmp(transport);
View Full Code Here

        // either tcp or udp
        if ("tcp".equals(endpoint.getProtocol())) {
            this.transport = new DefaultTcpTransportMapping();
        } else if ("udp".equals(endpoint.getProtocol())) {
            this.transport = new DefaultUdpTransportMapping();
        } else {
            throw new IllegalArgumentException("Unknown protocol: " + endpoint.getProtocol());
        }

        this.snmp = new Snmp(this.transport);
View Full Code Here

        // either tcp or udp
        if ("tcp".equals(endpoint.getProtocol())) {
            this.transport = new DefaultTcpTransportMapping((TcpAddress)this.listenGenericAddress);
        } else if ("udp".equals(endpoint.getProtocol())) {
            this.transport = new DefaultUdpTransportMapping((UdpAddress)this.listenGenericAddress);
        } else {
            throw new IllegalArgumentException("Unknown protocol: " + endpoint.getProtocol());
        }

        this.snmp = new Snmp(transport);
View Full Code Here

    }
    pdu.setEnterprise(oid);
    pdu.setGenericTrap(PDUv1.ENTERPRISE_SPECIFIC);
   
    try {
      DefaultUdpTransportMapping udpTransportMap = new
        DefaultUdpTransportMapping();
      Snmp snmp = new Snmp(udpTransportMap);
      ResponseEvent response =  snmp.send(pdu, target);
      logger.debug("trap pdu: " + pdu);
      logger.trace("response: " + response);
View Full Code Here

    address = address + "/" + port;
    Address targetAddress = GenericAddress.parse(address);
    Snmp snmp;
   
    try {
      TransportMapping transport = new DefaultUdpTransportMapping();
      snmp = new Snmp(transport);
      CommunityTarget target = new CommunityTarget();
      target.setCommunity(new OctetString(community));
      target.setAddress(targetAddress);
      target.setRetries(0);
View Full Code Here

    int ret = 0;   
    address= address + "/" + port;
   
    try {
      Address targetaddress = new UdpAddress(address);
      TransportMapping transport = new DefaultUdpTransportMapping();
      transport.listen();
      CommunityTarget comtarget = new CommunityTarget();
      comtarget.setCommunity(new OctetString(community));
      comtarget.setVersion(SnmpConstants.version1);
      comtarget.setAddress(targetaddress);
      comtarget.setRetries(2);
View Full Code Here

    listenAddress =
        GenericAddress.parse(System.getProperty("snmp4j.listenAddress",
                                                "udp:0.0.0.0/162"));
    TransportMapping transport;
    if (listenAddress instanceof UdpAddress) {
      transport = new DefaultUdpTransportMapping((UdpAddress)listenAddress);
    }
    else {
      transport = new DefaultTcpTransportMapping((TcpAddress)listenAddress);
    }
    snmp = new Snmp(dispatcher, transport);
View Full Code Here

        SnmpConstants.DEFAULT_COMMAND_RESPONDER_PORT);

    final UsmUser usmUser = new UsmUser(V3SECURITYNAME, V3AUTHPROTO,
        V3AUTHPASS, V3PRIVPROTO, V3PRIVPASS);
    this.v1Client = new StandardSNMPv1<UdpAddress>(V1V2COMMUNITY,
        new DefaultUdpTransportMapping());
    this.v2Client = new StandardSNMPv2<UdpAddress>(V1V2COMMUNITY,
        new DefaultUdpTransportMapping());
    this.v3Client = new StandardSNMPv3<UdpAddress>(usmUser,
        new OctetString(), new DefaultUdpTransportMapping());

    this.allClients.add(this.v1Client);
    this.allClients.add(this.v2Client);
    // this.allClients.add(this.v3Client);
View Full Code Here

TOP

Related Classes of org.snmp4j.transport.DefaultUdpTransportMapping$ListenThread

Copyright © 2018 www.massapicom. 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.