|
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
|
| 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
$
|