Chapter Contents

Previous

Next
Inter-User Communications Vehicle (IUCV) Functions

IUCV Parameter Lists and External Interrupt Data Formats

The header file for the IUCV functions is <cmsiucv.h> . Three structures cover all IUCV parameter lists and external interrupt data formats. Each structure used in IUCV communication is discussed on the following pages. As indicated by the comments, <cmsiucv.h> parameter list fields correspond to fields in the parameter lists for each individual IUCV function. These fields are explained in detail in the IBM documentation mentioned in Introduction.

The structure iucv_path_plist defines the ACCEPT, CONNECT, QUIESCE, RESUME, and SEVER parameter list. External interrupt data are defined for PENDING CONNECTION, CONNECTION COMPLETE, SEVER, QUIESCE, and RESUME external interrupts.

struct iucv_path_plist {
   short pathid;                  /* IPPATHID                      */
   char flags1;                   /* IPFLAGS1                      */
   union {
      char rcode;                 /* IPRCODE                       */
      char type;                  /* IPTYPE                        */
   } ip;
   short msglim;                  /* IPMSGLIM                      */
   char fcncd;                    /* IMFCNCD                       */
   char _;
   char vmid[8];                  /* IPVMID                        */
   char pgm[8]                   /* IPUSER                        */
   char user[8]
   double _d;                     /* (used only for alignment)     */
};

typedef struct iucv_path_plist iucv_path_data;

The structure iucv_msg_plist defines the parameter list for the RECEIVE, REJECT, REPLY, and SEND functions. External interrupt data are defined for the pending message external interrupt.

struct iucv_msg_plist {
   short pathid;                  /* IPPATHID                       */
   char flags1;                   /* IPFLAGS1                       */
   union {
      char rcode;                 /* IPRCODE                        */
      char type;                  /* IPTYPE                         */
   } ip;
   int msgid;                     /* IPMSGID                        */
   int tgrcls;                    /* IPTRGCLS                       */
   union {
      char data[8];               /* IPRMMSG1/IPRMMSG2              */
      struct _adlen bf1;          /* IPBFADR1/IPBFLN1F              */
   } msg;
   int srccls;                    /* IPSRCCLS                       */
   int msgtag;                    /* IPMSGTAG                       */
   struct _adlen bf2;             /* IPBFADR2/IPBFLN2F              */
   double _d;                     /* (used only for alignment)      */
};

typedef struct iucv_msg_plist iucv_msg_data;

The last of the three IUCV structures is iucv_comp_plist . This structure defines the parameter list for the PURGE and TEST COMPLETION functions. External interrupt data are defined for the complete message external interrupt.

struct iucv_comp_plist {
   short pathid;                  /* IPPATHID                       */
   char flags1;                   /* IPFLAGS1                       */
   union {
      char type;                  /* IPTYPE                         */
      char rcode;                 /* IPRCODE                        */
   } ip;
   int msgid;                     /* IPMSGID                        */
   unsigned audit;                /* IPAUDIT (byte 4 not applicable)*/
   char msgdata[8]               /* IPRMMSG1/IPRMMSG2              */
   int srccls;                    /* IPSRCCLS                       */
   int msgtag;                    /* IPMSGTAG                       */
   int _;
   int bfln2f;                    /* IPBFLN2F                       */
   double _d;                     /* (used only for alignment)      */
};

typedef struct iucv_comp_plist iucv_comp_data;

The values for the interrupt subtypes, as defined for the structure variable ip.type , are shown in the following table:

Variable Value
CONNECTION_PENDING 1
CONNECTION_COMPLETE 2
PATH_SEVERED 3
PATH_QUIESCED 4
PATH_RESUMED 5
INCOMING_PRI_REPLY 6
INCOMING_REPLY 7
INCOMING_PRI_MSG 8
INCOMING_MSG 9

The type definitions (such as iucv_path_data ) and interrupt types ( ip.type ) enable you to control the way your program handles IUCV interrupts. The following code illustrates how this can be done:

iucv_path_data *XID;

XID = (iucv_path_data *) siginfo(); 
switch (XID->  ip.type) {
   case CONNECTION_COMPLETE: 
      break;
   case INCOMING_REPLY:   /* Get reply length. */ 
      rep_len = ((iucv_msg_data *)XID)->  bf2.ln;  
      break; 
}

In this section of code, a cast expression converts the value returned by siginfo to a pointer of type iucv_path_data so it can be assigned to XID. A case statement is then used to handle the possible interrupt subtypes returned in ip.type .


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.