-----------------------------------------------------------------------

	"@(#)README 3.2 98/09/29 SMI"

	Copyright (c) 09/29/98, by Sun Microsystems, Inc.
	All rights reserved.

-----------------------------------------------------------------------

			SNMP Agent Example
			==================


-----------------------------------------------------------------------
1. Example overview
-----------------------------------------------------------------------
The current directory contains the following source files:
    * Agent.java:
 	- Initializes the framework.
	- Adds an HTML adaptor and an RMI adaptor to the framework.
	- Adds an SNMP adaptor. The adaptor is bound to a nonstandard
	  SNMP port (8085). This avoids having to start the agent as 
	  root, as is required by some operating systems for binding to a
	  standard SNMP port.
	- Creates and initializes a SNMP MIB. Every group in the MIB
	  is registered with  framework. This enables them to be managed
	  through the other adaptors in the agent (namely HTML and RMI).

   * SecureAgent.java:
	- Same content as Agent.java showing an example of a simple 
	  use of the SnmpPduFactoryIf. The SecureAgent can take as
	  input a list of host names whose request pdus will be rejected.

   * StandAloneSnmpAgent.java:
	- Implements a standalone SNMP agent. A standalone SNMP agent
	  does not contain the framework. The only component of the Java
	  DMK required is the SNMP adaptor.
	- Adds an SNMP adaptor. The adaptor is bound to a nonstandard
	  SNMP port (8085). This avoids having to start the agent as 
	  root, as is required by some operating systems for binding to a
	  standard SNMP port.
	- Creates and initializes a SNMP MIB.

   * EnumIfAdminStatus.java, EnumIfOperStatus.java, EnumIfType.java, and 
     EnumSnmpEnableAuthenTraps.java:
        - Are generated by mibgen for representing enumerations defined
	  in MIB II.

   * System.java and SystemMeta.java:
        - Are generated by mibgen. They represent the system group 
	  defined in MIB II, and store metadata on this group.

   * SystemImpl.java:
        - Is a real implementation of the system group defined in MIB-II.

   * Interfaces.java and InterfacesMeta.java:
        - Are generated by mibgen. They represent the interfaces group 
	  defined in MIB II, and store metadata on this group.

   * InterfacesImpl.java:
        - Is a dummy implementation of the interfaces group defined in
	  MIB-II.
	- Declares TableEntryListenerImpl as listener to added/removed table entries

   * Snmp.java and SnmpMeta.java:
        - Are generated by mibgen. They represent the Snmp group 
	  defined in MIB II, and store metadata on this group.

   * SnmpImpl.java:
        - Is a dummy implementation of the Snmp group defined in
	  MIB-II.

   * IfEntry.java.java and IfEntryMeta.java:
        - Are generated by mibgen. They represent an entry in the IfTable
	  table, and store metadata on this entry.

   * IfEntryImpl.java:
        - Is a dummy implementation of the ifEntry entry defined in MIB-II.
        - Registers each entry of an SNMP table with the framework.
	- Sends SNMP traps.

   * TableIfTable.java:
        - Is generated by mibgen for representing the ifTable table 
	  defined in interfaces group.	


   * RFC1213_MIB.java:
        - Is generated by mibgen for representing the subset MIB II.
	- All the modifications that have been made are contained
	  between the 2 following tags:

		// MODIF_BEGIN
		...
		// MODIF_END	

   * LinkTrapGenerator.java:
        - Is a dummy implementation of an SNMP trap generator for
          a given interface.

   * TableEntryListenerImpl.java :
	- Is a dummy implementation of a SnmpTableEntryListener allowing to 
	  receive SnmpTableEntryEvent events when an entry is added or removed 
	  from ifTable table.

   * SnmpPduFactoryImpl.java :
	- Is a simple implementation of the SnmpPduFactoryIf interface which
	  rejects the pdus sent by certain hosts.	

   * jaw.acl:
	- Is an ACL file that you must customize to enable the agent 
	  to send SNMP traps (see Section 4).

   * mib_II.txt:
	- Contains the standard definition of MIB II.

   * mib_II_subset.txt:
 	- Contains the subset of mib_II.txt that defines the system,
	  snmp, and interfaces groups.

   * mib_core.txt:
	- Contains a set of common definitions required by mibgen for
	  compiling MIB II.

  Note : For more information on the specification of the SnmpPduFactoryIf 
	 interface you can refer to SnmpPduFactoryIfSpec.html.
	
-----------------------------------------------------------------------
2. Running the precompiled version
-----------------------------------------------------------------------
To run the precompiled version of the example, type the following
commands:

   setenv CLASSPATH /opt/SUNWconn/jaw/examples/classes:/opt/SUNWconn/jaw/classes/jawco.jar:/opt/SUNWconn/jaw/classes/jawag.jar:/opt/SUNWconn/jaw/classes/jawcl.jar:/opt/SUNWconn/jaw/classes/jawcs.jar:/opt/SUNWconn/jaw/classes/jawtk.jar

   # Make sure that no agents are already running 
   # and start the agent:

   java examples.snmp.agent.Agent
 -or-
   java examples.snmp.agent.StandAloneSnmpAgent
 -or-
  java examples.snmp.agent.SecureAgent

-----------------------------------------------------------------------
3. Building and running your own version
-----------------------------------------------------------------------
To build your own version of the example, copy the example source files
to your working directory and type the following commands:

   cd <WORKING_DIR>

   setenv CLASSPATH .:/opt/SUNWconn/jaw/examples/classes:/opt/SUNWconn/jaw/classes/jawco.jar:/opt/SUNWconn/jaw/classes/jawag.jar:/opt/SUNWconn/jaw/classes/jawcl.jar:/opt/SUNWconn/jaw/classes/jawcs.jar:/opt/SUNWconn/jaw/classes/jawtk.jar

   mibgen -tp examples.snmp.agent -d . mib_II_subset.txt mib_core.txt

   javac -d . *.java


To run the version of the example you have just built, type the
following commands:

   # Make sure that no agents are already running 
   # and start the agent:

   java examples.snmp.agent.Agent
 -or-
   java examples.snmp.agent.StandAloneSnmpAgent
 -or-
   java examples.snmp.agent.SecureAgent

-----------------------------------------------------------------------
4. Enabling SNMP traps (optional)
-----------------------------------------------------------------------
To enable SNMP traps, type the following commands:

   # Log in as root or become superuser: 

   su

   # Copy the ACL file into a predefined location:

   cp jaw.acl /etc/opt/SUNWconn/jaw/conf/jaw.acl

   # Customize the ACL file by replacing "yourmanager" 
   # with the hostname of your manager.

