Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SnmpContext"/> class.
 /// </summary>
 /// <param name="request">The request.</param>
 /// <param name="sender">The sender.</param>
 /// <param name="users">The users.</param>
 /// <param name="group">The engine core group.</param>
 /// <param name="binding">The binding.</param>
 protected SnmpContext(ISnmpMessage request, IPEndPoint sender, UserRegistry users, EngineGroup group, IListenerBinding binding)
 {
     Request     = request;
     Binding     = binding;
     Users       = users;
     Sender      = sender;
     CreatedTime = DateTime.Now;
     Group       = group;
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SnmpEngine"/> class.
 /// </summary>
 /// <param name="factory">The factory.</param>
 /// <param name="listener">The listener.</param>
 /// <param name="group">Engine core group.</param>
 public SnmpEngine(SnmpApplicationFactory factory, Listener listener, EngineGroup group)
 {
     _factory = factory;
     Listener = listener;
     _group   = group;
 }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SecureSnmpContext"/> class.
 /// </summary>
 /// <param name="request">The request.</param>
 /// <param name="sender">The sender.</param>
 /// <param name="users">The users.</param>
 /// <param name="group">The engine core group.</param>
 /// <param name="binding">The binding.</param>
 public SecureSnmpContext(ISnmpMessage request, IPEndPoint sender, UserRegistry users, EngineGroup group, IListenerBinding binding)
     : base(request, sender, users, group, binding)
 {
 }
Example #4
0
        /// <summary>
        /// Creates the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <param name="sender">The sender.</param>
        /// <param name="users">The users.</param>
        /// <param name="group">The engine group.</param>
        /// <param name="binding">The binding.</param>
        /// <returns></returns>
        public static ISnmpContext Create(ISnmpMessage request, IPEndPoint sender, UserRegistry users, EngineGroup group, IListenerBinding binding)
        {
            if (request.Version == VersionCode.V3)
            {
                return(new SecureSnmpContext(request, sender, users, group, binding));
            }

            return(new NormalSnmpContext(request, sender, users, binding));
        }