The following sample PL/I code builds and issues the SIOCGPARTNERINFO
ioctl. The SIOCGPARTNERINFO ioctl retrieves the connection routing
information and the security credentials of a partner.
⋮
/* SIOCGPartnerInfo ioctl mapping and constants */
% include EZBPINF1;
⋮
dcl 1 IoctlBuffer Based,
3 data char(PI_FIXED_SIZE + PI_UTOKEN_EXT_SIZE);
⋮
/*********************************************************************/
/* Allocate the IOCTL buffer for SIOCGPARTNERINFO and issue ioctl. */
/*********************************************************************/
allocate ioctlBuffer set(piPtr);
piPtr->PI_Version = PI_VERSION_1;
piPtr->PI_ReqType = PI_REQTYPE_PARTNER_USERID
+ PI_REQTYPE_PARTNER_UTOKEN;
piPtr->PI_TimeOut = PI_TIMEOUT_MAXIMUM;
piPtr->PI_BufLen = PI_FIXED_SIZE + PI_UTOKEN_EXT_SIZE;
call ezasoket(IOCTL,
SOCK_STREAM,
SIOCGPARTNERINFO, /* SIOCGPARTNERINFO ioctl */
piPtr->IoctlBuffer, /* input buffer */
piPtr->IoctlBuffer, /* output buffer */
ERRNO,
RETCODE);