/*********************************************************************/
/*                                                                   */
/* SNMP-DPI API - SNMP Distributed Protocol Interface                */
/*                Application Programming Interface                  */
/*                                                                   */
/* Sep 26, 1995 - Version 0.01                                       */
/*                                                                   */
/* Copyright    - (C) International Business Machines Corp. 1994     */
/*                                                                   */
/*   Permission to use, copy, modify, and distribute this software   */
/*   and its documentation for any lawful purpose and without fee is */
/*   hereby granted, provided that this notice be retained unaltered,*/
/*   and that the names of IBM and all other contributors shall not  */
/*   be used in advertising or publicity pertaining to distribution  */
/*   of the software without specific written prior permission.      */
/*   No contributor makes any representations about the suitability  */
/*   of this software for any purpose.  It is provided "as is"       */
/*   without express or implied warranty.                            */
/*                                                                   */
/*   IBM AND ALL OTHER CONTRIBUTORS DISCLAIM ALL WARRANTIES WITH     */
/*   REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF    */
/*   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, TITLE,    */
/*   AND NON-INFRINGEMENT.                                           */
/*                                                                   */
/*   IN NO EVENT SHALL IBM OR ANY OTHER CONTRIBUTOR BE LIABLE FOR    */
/*   ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES, WHETHER IN      */
/*   CONTRACT, TORT, OR OTHER FORM OF ACTION, ARISING OUT OF OR IN   */
/*   CONNECTION WITH, THE USE OR PERFORMANCE OF THIS SOFTWARE.       */
/*                                                                   */
/*********************************************************************/

This DPI to SMUX converter proxy agent source code is provided as an example
to:
  * convert the DPI version 2 protocol to SMUX protocol. That is.... it
    can be used, but the mapping is not complete. This can be used as a
    stopgap till we possibly get native DPI 2.0 support in the SNMP agent 
    on AIX.  (this is not a commitment that this will actually happen)
  * illustrate a SMUX peer, and
  * illustrate how to force a program to fork and separate from the tty
    so that it runs in the background forever.

The DPI to SMUX proxy agent, dpid2, converts the DPI version 2 protocol to 
the SMUX protocol.  When the dpidi2 daemon is running, DPI peers, or subagents,
communicate with dpid2 via the DPI protocol.  The dpid daemon converts the
information into the SMUX protocol and interfaces with snmpd.  Thus, snmpd
only knows about the dpid SMUX peer.  snmpd does not know about the DPI
peers that are communicating with dpid.

The dpid2 executable must be compiled as only the source code is provided.
A Makefile has been provided and is ready to use "as is".   This Makefile is
shipped in the file, /usr/lpp/snmpd/dpi/dpid2/Makefile.  To compile the dpid2
DPI to SMUX protocol converter executable, at the shell prompt enter:
  make

The dpid SMUX peer must run as root user.  It may be easiest to have it
set-uid root:
  su
  Password:
  chown root dpid2
  chmod u+s dpid2
		
Before you execute the dpid2 daemon, you will need to update the 
/etc/snmpd.peers files by adding the following entry for dpid:
"dpid2"       1.3.6.1.4.1.2.3.1.2.2.1.1.2       "dpid_password"

You will also need to update the /etc/snmpd.conf file by adding a smux entry 
for dpid:
smux        1.3.6.1.4.1.2.3.1.2.2.1.1.2 	dpid_password     #dpid

Refresh snmpd so that it will reread the /etc/snmpd.conf file:
  refresh -s snmpd

Start the dpid SMUX peer:
  dpid

Using snmpinfo, walk the smux MIB tree to see that dpid has registered
successfully.  The dump should also show that the dpiSMUXport subtree has
been registered successfully.
  /usr/sbin/snmpinfo -v -md smux

The dpid2 object id as defined above is "1.3.6.1.4.1.2.3.1.2.2.1.1.2".  
The breakdown of the dotted notation is:
  1  iso
  3  org
  6  dod
  1  internet
  4  private
  1  enterprises
  2  ibm
  3  ibmAgents
  1  aix
  2  aixRISC6000
  2  risc6000private
  1  risc6000samples
  1  risc6000sampleAgents
  2  dpid

