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

	"@(#)README 1.6 99/03/23 SMI"

	Copyright (c) 03/23/99, by Sun Microsystems, Inc.
	All rights reserved.

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

			SNMP Proxy Example
			==================


-----------------------------------------------------------------------
1. Example overview
-----------------------------------------------------------------------
The SnmpMibAgentImpl class provides an example of implementation of an 
SNMP proxy.
Using this implementation, the Agent class is able to serve local MIBs 
as well as remote MIBs (that is MIBs running outside the VM where the 
agent is running). It acts as a single point of contact for a set 
of MIBs or sub-agents.
A local demo MIB is loaded into the Agent.
A remote MIB (subset of MIB II) is loaded into the StandAloneAgent.
The Manager class sends requests to the Agent using port 8085 and 
queries the Agent using both MIBs.

Note: to run this example, you can use either the StandAloneAgent or
any SNMP agent that knows the MIB II system group.


The current directory contains the following source files:
    * Agent.java:
 	- Initializes 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 the
	  standard SNMP port.
	- Creates and initializes the demo MIB (local MIB).
	- Creates and initializes the SNMP proxy.

   * SnmpMibAgentImpl.java:
	- Implements an SNMP proxy. An SNMP proxy behaves like a manager
	  on the agent side. It receives requests from the manager and
	  forwards them to the appropriate sub-agent.

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

   * Manager.java:
        - Initializes the SNMP manager API.
        - Uses services provided by the SNMP manager API to query an
          SNMP agent.

   * patchfiles/DEMO_MIB.java:
        - Originally generated by mibgen for representing the demo MIB.
	- Then modified to instantiate DemoImpl objects instead of
	  Demo objects.
	- All the modifications that have been made are contained
	  between the following two tags:

		// MODIF_BEGIN
		...
		// MODIF_END	

   * DemoImpl.java:
        - Is a real implementation of the demo group defined in the demo MIB.

   * patchfiles/RFC1213_MIB.java:
        - Is generated by mibgen for representing the subset MIB II.
	- Has been modified to instantiate SystemImpl objects instead of
	  System objects.
	- All the modifications that have been made are contained
	  between the following two tags:

		// MODIF_BEGIN
		...
		// MODIF_END	

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

   * mib_II_subset.txt:
 	- Contains the subset of mib_II.txt that defines the system group.

   * mib_demo.txt:
 	- Defines the demo group.

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

-----------------------------------------------------------------------
2. Building and running the example
-----------------------------------------------------------------------
To build the snmp proxy example, copy the example source files to your 
working directory and type the following commands:

   cd <WORKING_DIR>

   mibgen -d . -m mib_II_subset.txt mib_core.txt
 -and-
   mibgen -d . -m mib_demo.txt mib_core.txt

   # Replace the generated files RFC1213_MIB.java and DEMO_MIB.java 
   # by the ones provided under the patchfiles directory and then compile:

   javac -d . *.java


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

   # Start the StandAloneAgent.
   # The StandAloneAgent binds to port 8086.

   java StandAloneAgent

   # Start the Agent, specifying the host and the port of the sub-agent StandAloneAgent.
   # The Agent binds to port 8085.

   java Agent <host> 8086

   # Start the Manager, specifying the host and the port of the Agent.

   java Manager <host> 8085

