0.Contents
  --------
1.....Introduction
2.....Requirements
3.....List of files
4.....Installation
5.....Upon registration
6.....Usage
6.1...Generalities
6.2...Parameters
6.3...Return values
7.....Contacting the author
8.....Notice


1.Introduction
  ------------
This 32-bits DLL for Windows NT/95 decodes SNMP traps from their BER encoding
used in the network frames to a readable form.
It will produce a null delimited string that will contain the decoded and
formatted form of the trap. That string will already include embedded '\n'
to separate the different lines of the message (see 6.2).


2.Requirements
  ------------
A x86 processor with Windows NT/95.


3.List of files
  -------------
The package includes the following files:
   - README.1ST: a readme file to read before to begin with the
                 installation
   - README.TXT: this file
   - LICENSE.TXT: the license agreement
   - REGISTER.TXT: contains the information to register
   - WTRAP32.DLL: the DLL file implementing the "TrapDecod" function
   - WTRAP32.H: the header file containing the prototype of the "TrapDecod" function
   - WTRAP32.LIB: the lib file to put with your library files and
                  to include in your link parameters
   - SETUP.EXE: the setup program file


4.Installation
  ------------
You can put the files in any directory. The only limitation is for
running setup: you have to put SETUP.EXE and WTRAP32.DLL in the SAME
directory.
Simply run setup.exe. It will ask you for a registration key; leave
the field to 0 for demo purpose.
After a trial period of 30 days, the software will be disabled (RC=1) and
you will have to register to continue using it (see register.txt).


5.Upon registration
  -----------------
Simply run setup.exe again and enter your registration key.


6.Usage
  -----
6.1.Generalities
    ------------
As you should know, to use a DLL, you have to put it into the directory
of your application, your path or your system directory (e. g. winnt\system32).
This DLL implements the 'TrapDecod' function whose prototype is as follows:

    int TrapDecod(char *inbuf,char **outstr);

THE NECESSARY SPACE FOR OUTSTR IS ALLOCATED IN THE 'TrapDecod' FUNCTION.

6.2.Parameters
    ----------
    inbuf: a pointer to the buffer containing the data received from the network
           (e.g. a pointer to the buffer used in the socket call 'recv' or 
           'recvfrom')
    outstr: a pointer to a pointer pointing to the null delimited string that
            will contain the decoded and formatted form of the trap. That 
            string will already include embedded '\n' to separate the 
            different lines of the message. It will be of the form e.g.:

            SNMP Version: 0\nCommunity: public\nEnterprise: 1.3.6.1.2.1.11\n
            Agent-addr: xxx.yyy.zzz.ttt\nType of trap: Authentication failure
            trap\nEnterprise Specific trap:0\nTime ticks: xxxx\n


    A typical call to that function would be like this:

       char *bufdata,*trapstr;
       int ret;
                  .
                  .
                  .
       ret=RecvFrom(socket,bufdata,buffersize,0,NULL,NULL);
                  .
                  .
                  .
       ret=TrapDecod(bufdata,&trapstr);
                  .
                  .
                  .
       free(trapstr);
                  .
                  .
                  .


6.3.Return values
    -------------
     0: normal completion.
     1: your trial period has expired; you have now to register
        (see register.txt for more information's).
    16: memory allocation failure.


7.Contacting the author
  ---------------------
You can contact the author at the following location:

			Serge COLLIN
			rue Montoyer 37/3
			B-1000 Brussels
			BELGIUM (Europe)
			e-mail: sergecollin@hotmail.com


8.Notice
  ------
Windows 95 and Windows NT are trademarks of Microsoft Inc.