[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference ozrock::x25_avms

Title:DEC X.25 for OpenVMS AXP
Moderator:OZROCK::MUGGERIDGE
Created:Mon Jan 18 1993
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:524
Total number of notes:2218

508.0. "Example of X.25 application" by MLNCSC::DOMANESCHI () Wed Apr 09 1997 03:07

	Hello,

   sorry for the trivial question, have you an example of an application 
   that DECLARE a NETWORK PROCESS with static filter?
   This, why my customer is migrating his application from OpenVms Vax 
   with old P.S.I. to OpenVms Alpha and i should support he.
   Thanks in advance.
   Bye.

                                Paolo
T.RTitleUserPersonal
Name
DateLines
508.1DELNI::MUGGERIDGEWed Apr 09 1997 06:356
There are numerous examples supplied with the product.
Have you looked at them?  I don't know off hand whether
they meet your requirements.  I don't know what you mean
by a 'Static Filter'.

Matt.
508.2MARVIN::CARLINIWed Apr 09 1997 20:4610
>   sorry for the trivial question, have you an example of an application 
>   that DECLARE a NETWORK PROCESS with static filter?
>   This, why my customer is migrating his application from OpenVms Vax 
>   with old P.S.I. to OpenVms Alpha and i should support he.

If your customer is migrating, then he either does not need this functionality
or he already has an example of how to do it! Having said that, I don't think
you can do what you seem to want in a supported manner.

Antonio
508.3MLNCSC::DOMANESCHIThu Apr 10 1997 21:2615
   The X25 OpenVms Alpha configuration is different respect the old
   P.S.I. 4.3 on OpenVms Vax.
   On X.25 CLIENT FOR OPENVMS AXP SYSTEM Program Reference documentation 
   i read that when i DECLARE A NETWORK PROCESS, in the NETWORK PROCCESS
   DECLARATION BLOCK i can define the name of a static filter.
   How you have realized, i have no experience of X25 programming but with
   an example i can explain correctly at my customer the modifications that 
   he must do.
   Correctly the purpose of this conference not is explain the X25
   PROGRAMMING but if somebody in his directory has an example the thing is
   appreciated.
   Sincerely.

                             Paolo 
508.4Why change something that works?COMICS::WEIRJohn Weir, UK Country SupportThu Apr 24 1997 22:0731
Paolo,

The short answer is "I don't have an example"...

But, why create unnecessary work?

If I understand you correctly, then the Customer has a working application,
which declares itself as an X25-S Destination (in P.S.I. V4.3A terminology), and
this works fine on P.S.I. V4.3A.

There is a very high probability that this same application will work on
Alpha VMS X.25, without modification (assuming that you are running a current
version, such as V1.0G or V1.1B and not some buggy old predecessor). The
unmodified application will do the equivalent of creating a dynamic filter
(that's the 'compatibility' mode for V4.3A declare destination). Most things
will work, except for a) application bugs that V4.3A did not detect, and b)
use of subaddresses. If you modify the application to use static templates
then a) you may introduce new bugs and may or may not remove the old ones, and
b) you will still not be able to use subaddresses in the same way as P.S.I.
V4.3A.

So, in summary, you have proposed to create some extra work, but have not
made it clear why this is a good thing!

By the way, are you charging the Customer for this assistance?

Regards,

	John Weir

508.5Also Example neededBACHUS::GOOVAERTSTue Apr 29 1997 04:1512
    Hi,
    
    
    
    	I have a customer who's looking also for an example of a network
    	declared object program for receiving calls via X.25.
    
    	There is no example in the x25 examples,so does anybody has
    	just a pointer to something.I don't want to spent 
    	much time on this,so If somebody has an example....?
    
    
508.6exampleHTKING::M_SHELDONTue Apr 29 1997 12:02361
I have a VAX example modified for OpenVMS Alpha given to me several years ago.
The comments in the code have not been updated. It compiles and links ok... 
and seems to work. No guarantees.

See the X25 Access filter Gtest below, and the code.

						Mike Sheldon
						CSC/CS Network Support

--------------------------------------------------------------------------
$ cc PSI$X25_DECLARED_RECEIVE_C/standard=vaxc/nomemberalign
$ link PSI$X25_DECLARED_RECEIVE_C
$ run PSI$X25_DECLARED_RECEIVE_C

--------------------------------------------------------------------------
/*
*  			COPYRIGHT (C) 1987
* 	DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS, USA
* 
*  THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED 
*  ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENCE AND WITH THE INCLUSION
*  OF THE ABOVE COPYRIGHT NOTICE.   THIS  SOFTWARE,  OR  ANY  OTHER  COPIES
*  THEREOF, MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE  TO  ANY  OTHER
*  PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
* 
*  THE INFORMATION IN THIS SOFTWARE IS SUBJECT  TO  CHANGE  WITHOUT  NOTICE
*  AND SHOULD NOT  BE  CONSTRUED  AS  A  COMMITMENT  BY  DIGITAL  EQUIPMENT
*  CORPORATION.
* 
*  DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR THE RELIABILITY OF  ITS 
*  SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
* 
**++
**
**  FACILITY:
**
**      VAX P.S.I. Example Program
**
**  ABSTRACT:
**
**	RECEIVE PROGRAM
**      This program is one of a pair of demonstration programs which will
**	transfer data entered at the terminal from one VAX to another over
**	a Packet Switching Data Network.  This program should  be  defined
**	as an object to be run for an incoming call.
**
**  ENVIRONMENT:
**
**	Native mode VAX processor, User mode.
**
**  COMPILATION/LINKAGE:
**
**	$ CC this_prog
**	$ LINK this_prog, sys$library:vaxcrtl/lib
**	  RUN this_prog as a P.S.I. object
**
**   FUNCTIONAL DESCRIPTION:
** 
**      * Include external macro and constant definitions
**        and define local macros and constants
**      * Declare structures for NCB descriptor, mailbox message and IOSB
** 	* Assign a mailbox for the network device to SYS$NET
**	* Assign an input/output (I/O) channel to the network
**        device (NWA0:)
** 	* Wait until a connection request appears in mailbox
** 	* Accept the connection
** 	* Loop reading data until control-z received
** 	* Clear the call
** 	* Deassign the mailbox and I/O channels
**
**--
**/

/*
* Included macros and definitions
*/
#include stdio				/* Standard C i/o		*/
#include ssdef				/* VAX/VMS System services	*/
#include descrip			/* Descriptors			*/
#include iodef				/* VAX/VMS i/o definitions	*/
#include perror				/* VAXC-RTL error handlers	*/
#include "sys$library:psilib.h" 
#include "sys$library:nfbdef.h"
 
/*
* Local macros and definitions
*/
 
#define check_status(x) if (!((x) & 1)) SYS$EXIT(x)	/* Error handler*/
#define IOBSZ 128
#define CTRLZ	26
 
 
/*
* Entry point 
*/
 
exa$psi_receive()
MAIN_PROGRAM
{
    /*
    * Local storage
    */
 
    int status;					/* Service return stat	*/
    short psi_channel, mbx_channel;		/* Channel numbers	*/
    char iobuf[IOBSZ];				/* I/o buffers		*/
    
    /*
    * Mailbox message buffer 
    */
    
    static struct mbx_mess {
    	short msgtype;
    	short unit;
    	unsigned char name_siz;
    	char name[15];
    	unsigned char info_siz;
    	char info[179];
    } mbx_mess;
 
    /*
    * NCB Descriptor - will be completed from mbx info
    */
    
    static struct dsc$descriptor ncb_desc = {	0,
    						DSC$K_DTYPE_VT,
    						DSC$K_CLASS_VS,
    						0	};
 
    /*
    * IO Status block definition
    */
 
    volatile struct {
        unsigned short	status;			/* Final io status	*/
        unsigned short	dlen;			/* Usually data length	*/
        unsigned short 	devdep1, devdep2;	/* Device dependent	*/
        }  iosb;
 
    /*
    * Static string descriptors for mailbox and network device
    */
 
    struct descriptor { long length;
			unsigned long address;
			} nfb_desc, ntd_desc, *foobar;

    char nfb[5] = { NFB$C_DECLNAME , 0, 0, 0, 0 };

    struct NTD {
	    short length, code;
            char data[6];
             } ntd[3];

    char dest_name[11];

    static $DESCRIPTOR(mbx_name, "TEST");
    static $DESCRIPTOR(dev_name, "_NWA0:");

    memset(&ntd, 0, 3 * sizeof(struct NTD));

    ntd[0].length=sizeof(struct NTD);
    ntd[0].code=psi$c_ntd_acclvl;
    strcpy(&ntd[0].data[1], "X25L3");
    ntd[0].data[0] = (char)strlen("X25L3");


    strcpy(&ntd[1].data[1], "Gtest");
    ntd[1].data[0] = (char)strlen(&ntd[1].data[1]);

    ntd[1].length = sizeof(struct NTD);
    ntd[1].code = psi$c_ntd_name;
    

    ntd_desc.length = ntd[0].length + ntd[1].length;

    ntd_desc.address = &ntd;

    nfb_desc.length = 5;
    nfb_desc.address = &nfb;
    						/* Assign a channel	*/
    status = sys$crembx (
		 0, 
		 &mbx_channel, 
		 0, 
		 0, 
		 0, 
		 0, 
		 &mbx_name);
  check_status(status);

    status = SYS$ASSIGN(&dev_name,		/* to network device	*/
    			&psi_channel,		/* channel number	*/
    			0,
    			&mbx_name);		/* associated mailbox   */
    check_status(status);			/* Check for error	*/
 
    status = sys$qiow (
		 0, 
		 psi_channel, 
		 IO$_ACPCONTROL, 
		 &iosb, 
		 0, 
		 0, 
		 &nfb_desc, 
		 &ntd_desc, 
		 0, 
		 0, 
		 0, 
		 0);

  check_status(status);
  check_status(iosb.status);
  
    /*
    * Read connect message from mailbox and accept call. The NCB is stored
    * in the information field of the standard mailbox device message as a
    * counted string.
    */   

    status = sys$qiow(	0,			/* Issue QIO and wait	*/
    			mbx_channel,		/* to mailbox channel	*/
    			IO$_READVBLK,		/* function is read	*/
    			&iosb,			/* I/O status block	*/
    			0,
    			0,
    			&mbx_mess,		/* mailbox buffer	*/
    			sizeof(struct mbx_mess),/* and its size		*/
    			0,
    			0,
    			0,
    			0);
 check_status(status);
    check_status(iosb.status);			/* Check for I/O error	*/
   
 
 
    /*
    * Initialise NCB descriptor
    */
 
    ncb_desc.dsc$w_length = (unsigned short) mbx_mess.info_siz;
    ncb_desc.dsc$a_pointer = mbx_mess.info;
 
    /*
    * Code to analyse NCB and decide whether to accept call
    */    
 
    /* ... */
 
    /* Accept call */

    status = sys$qiow(	0, 			/* Issue QIO and wait	*/
    			psi_channel,		/* to network device	*/
    			IO$_ACCESS|IO$M_ACCEPT,	/* fn is accept call	*/
    			&iosb,			/* I/O status block	*/
    			0,
    			0,
    			0,
    			&ncb_desc,		/* NCB descriptor    	*/
    			0,
    			0,
    			0,
    			0);
    check_status(status);			/* Check for error	*/
    check_status(iosb.status);
 
 
    /*
    * Enter mainloop to read from the remote process and write it to stdout
    * stream.  When end of file is received the call will be cleared.
    */
 
    /*
    * Read until EOF
    */
    while(*iobuf != CTRLZ) {

    	status = sys$qiow(0,			/* Issue QIO and wait	*/
    			psi_channel,		/* from network device	*/
    			IO$_READVBLK,		/* function is read	*/
    			&iosb,			/* I/O status block	*/
    			0,
    			0,
    			iobuf, 			/* buffer address	*/
    			IOBSZ,			/* and size 		*/
    			0,
    			0,
    			0,
    			0);
    	check_status(status);
    	check_status(iosb.status);		/* Check for I/O error	*/
 
	if (*iobuf != CTRLZ)
	    if (puts(iobuf) == -1) {		/* Write to stdout	*/
    		perror("PSI_RECEIVE");		/* RTL I/O error	*/
    		exit(1);
	    }
    }
 
    /*
    * End of file was received from remote process, clear the call and
    * deassign the I/O channels.
    */
    
    status = sys$qiow(	0,			/* Issue QIO and wait	*/
    			psi_channel,		/* to network device	*/
    			IO$_DEACCESS,		/* fn is clear call	*/
    			&iosb,			/* I/O status block	*/
    			0,
    			0,
    			0,
    			0,
    			0,
    			0,
    			0,
    			0);
    check_status(status);
    check_status(iosb.status);			/* Check for I/O error	*/
 
    status = SYS$DASSGN(psi_channel);		/* Deassign netwk device*/
    check_status(status);			/* Check for error	*/
 
    status = SYS$DASSGN(mbx_channel);		/* Deassign mailbox	*/
    check_status(status);			/* Check for error	*/
 
    SYS$EXIT(SS$_NORMAL);			/* Exit with success	*/

}

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

$ mc ncl sho x25 access filter *

Node 0 X25 Access Filter Gtest
at 1997-04-28-15:42:14.619-06:00I1.051

Identifiers

    Name                              = Gtest


Node 0 X25 Access Filter "OSI Transport"
at 1997-04-28-15:42:14.619-06:00I1.051

Identifiers

    Name                              = "OSI Transport"


Node 0 X25 Access Filter X29
at 1997-04-28-15:42:14.620-06:00I1.051

Identifiers

    Name                              = X29

$


508.7ThanksBACHUS::GOOVAERTSTue Apr 29 1997 19:136
    Thanks,
    
    	you made my day.
    
    Danny