createV3Session static method

Future<Snmp> createV3Session(
  1. InternetAddress target,
  2. User user, {
  3. int port = 161,
  4. int trapPort = 162,
  5. int retries = 1,
  6. Duration timeout = const Duration(seconds: 5),
  7. InternetAddress? sourceAddress,
  8. int? sourcePort,
  9. Level logLevel = logging.Level.INFO,
})

Opens an SNMP v3 session with target

Implementation

static Future<Snmp> createV3Session(

    /// The address of the target device we want to communicate with
    InternetAddress target,

    /// The user credential to use when communicating via SNMP v3
    User user,

    /// The port which the target device has opened for snmp traffic
    {int port = 161,

    /// The local port where we intend to receive snmp trap messages
    int trapPort = 162,

    /// How many times to retry a single snmp request before throwing
    int retries = 1,

    /// How long to wait for a single snmp request to resolve
    Duration timeout = const Duration(seconds: 5),

    /// The local address to listen for snmp responses on
    InternetAddress? sourceAddress,

    /// The local port to listen for snmp responses on
    int? sourcePort,
    logging.Level logLevel = logging.Level.INFO}) async {
  var session = Snmp._(
      target, port, trapPort, retries, timeout, SnmpVersion.V3,
      user: user, logLevel: logLevel);
  await session._bind(address: sourceAddress, port: sourcePort);
  return session;
}