z/OS Communications Server: IP Programmer's Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


COBOL example – SIOCGPARTNERINFO ioctl call

z/OS Communications Server: IP Programmer's Guide and Reference
SC27-3659-02

The following sample COBOL code builds and issues the SIOCGPARTNERINFO ioctl. The SIOCGPARTNERINFO ioctl retrieves the connection routing information and the security credentials of a partner.

⋮
*==============* 
 Data Division.  
*==============* 
*---------------------------------------------------------------*
* Variables used by the SIOCGPARTNERINFO IOCTL call             *
*---------------------------------------------------------------*
 01  partnerinfo-data pic x.                                     
     COPY EZBPINFB.
 01  FIELD-DEFINE           PIC X(4).
 01  FIELD-DEFINEVALUE redefines field-DEFINE.
   02 defineNum             PIC 9(8) Binary.
 01  FIELD-DEFINE1          PIC X(4).
 01  FIELD-DEFINE1VALUE redefines field-DEFINE1.
   02 defineNum1            PIC 9(8) Binary.
⋮
*=============================================*  
 Procedure Division.                    
*=============================================*  
⋮
*****************************************************************
* Issue IOCTL SIOCGPARTNERINFO                                  *
*****************************************************************
 SiocGPartnerInfo-Ioctl.
     move PI-VERSION-1 to PI-VERSION.                
     move PI-TIMEOUT-MAXIMUM to PI-TIMEOUT.
                                                                 
     move PI-FIXED-SIZE to PI-BUFLEN.
     add  PI-UTOKEN-EXT-SIZE to PI-BUFLEN.

     move PI-REQTYPE-PARTNER-USERID to FIELD-DEFINE. 
     move PI-REQTYPE-PARTNER-UTOKEN to FIELD-DEFINE1.
     add defineNum1 to defineNum.
     move FIELD-DEFINE to PI-REQTYPE.

     move soket-ioctl to ezaerror-function.
     Call 'EZASOKET' using soket-ioctl socket-descriptor
         SIOCGPARTNERINFO         
         PARTNERINFO PARTNERINFO
         errno retcode.
 SiocGPartnerInfo-Ioctl-Exit.
          Exit. 

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014