View Javadoc
1   // NAME
2   //      $RCSfile: UsmAgent.java,v $
3   // DESCRIPTION
4   //      [given below in javadoc format]
5   // DELTA
6   //      $Revision: 3.8 $
7   // CREATED
8   //      $Date: 2006/03/23 14:54:10 $
9   // COPYRIGHT
10  //      Westhawk Ltd
11  // TO DO
12  //
13  
14  /*
15   * Copyright (C) 2001 - 2006 by Westhawk Ltd
16   * <a href="www.westhawk.co.uk">www.westhawk.co.uk</a>
17   *
18   * Permission to use, copy, modify, and distribute this software
19   * for any purpose and without fee is hereby granted, provided
20   * that the above copyright notices appear in all copies and that
21   * both the copyright notice and this permission notice appear in
22   * supporting documentation.
23   * This software is provided "as is" without express or implied
24   * warranty.
25   * author <a href="mailto:snmp@westhawk.co.uk">Tim Panton</a>
26   */
27  
28  package uk.co.westhawk.snmp.stack;
29  
30  /*-
31   * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
32   * SNMP Java Client
33   * ჻჻჻჻჻჻
34   * Copyright 2023 MetricsHub, Westhawk
35   * ჻჻჻჻჻჻
36   * This program is free software: you can redistribute it and/or modify
37   * it under the terms of the GNU Lesser General Public License as
38   * published by the Free Software Foundation, either version 3 of the
39   * License, or (at your option) any later version.
40   *
41   * This program is distributed in the hope that it will be useful,
42   * but WITHOUT ANY WARRANTY; without even the implied warranty of
43   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
44   * GNU General Lesser Public License for more details.
45   *
46   * You should have received a copy of the GNU General Lesser Public
47   * License along with this program.  If not, see
48   * <http://www.gnu.org/licenses/lgpl-3.0.html>.
49   * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
50   */
51  
52  /**
53   * This interface provides the SNMPv3 USM (User-Based Security Model)
54   * authoritative details.
55   *
56   * <p>
57   * When the stack is used as authoritative SNMP engine it has to send
58   * its Engine ID and clock (i.e. Engine Boots and Engine Time) with each 
59   * message. 
60   * The engine who sends a Response, a Trapv2 or a Report is
61   * authoritative.
62   * </p>
63   *
64   * <p>
65   * Since this stack has no means in providing this information, this
66   * interface has to be implemented by the user.
67   * </p>
68   *
69   * <p>
70   * See <a href="http://www.ietf.org/rfc/rfc3414.txt">SNMP-USER-BASED-SM-MIB</a>.
71   * </p>
72   * @see SnmpContextv3#setUsmAgent
73   *
74   * @author <a href="mailto:snmp@westhawk.co.uk">Birgit Arkesteijn</a>
75   * @version $Revision: 3.8 $ $Date: 2006/03/23 14:54:10 $
76   */
77  public interface UsmAgent {
78      static final String version_id = "@(#)$Id: UsmAgent.java,v 3.8 2006/03/23 14:54:10 birgit Exp $ Copyright Westhawk Ltd";
79  
80      /**
81       * This name ("_myusmagent") is used to create an entry in the TimeWindow
82       * for the stack to act as authoritative engine.
83       */
84      public String MYFAKEHOSTNAME = "_myusmagent";
85  
86      /**
87       * Returns the authoritative SNMP Engine ID.
88       * It uniquely and unambiguously identifies the SNMP engine, within an
89       * administrative domain.
90       *
91       * <p>
92       * The Engine ID is the (case insensitive) string representation of a
93       * hexadecimal number, without any prefix, for example
94       * <b>010000a1d41e4946</b>.
95       * </p>
96       * 
97       * @see uk.co.westhawk.snmp.util.SnmpUtilities#toBytes(String)
98       */
99      public String getSnmpEngineId();
100 
101     /**
102      * Returns the authoritative Engine Boots.
103      * It is a count of the number of times the SNMP engine has
104      * re-booted/re-initialized since snmpEngineID was last configured.
105      */
106     public int getSnmpEngineBoots();
107 
108     /**
109      * Returns the authoritative Engine Time.
110      * It is the number of seconds since the snmpEngineBoots counter was
111      * last incremented.
112      */
113     public int getSnmpEngineTime();
114 
115     /**
116      * Returns the value of the usmStatsUnknownEngineIDs counter.
117      * The stack needs this when responding to a discovery request.
118      */
119     public long getUsmStatsUnknownEngineIDs();
120 
121     /**
122      * Returns the value of the usmStatsNotInTimeWindows counter.
123      * The stack needs this when responding to a discovery request.
124      */
125     public long getUsmStatsNotInTimeWindows();
126 
127     /**
128      * Sets the current snmp context.
129      */
130     public void setSnmpContext(SnmpContextv3Basis context);
131 }