OSI/MHS Management Programming Manual

Examples
OSI/MHS Management Programming Manual424824-001
C-58
Password Server Database
/* Function: open_receive */
/* Usage : rcv_file = open_receive (rcv_depth) */
/* Parameters: rcv_depth INPUT */
/*-------------------------------------------------------------------------*/
/* Open $RECEIVE with a constant RCV_DEPTH. Return the file descriptor */
/* for $RECEIVE. If there is an error, write the error message and abend. */
/***************************************************************************/
int open_receive (int rcv_depth)
{
int rcv_des;
rcv_des = open ("$RECEIVE",
O_BINARY,
/*security*/,
rcv_depth);
if (rcv_des < 0)
{
printf ("$RECEIVE file open error\n");
exit (EXIT_FAILURE);
}
return rcv_des;
} /* end proc open_receive */
/***************************************************************************/
/* Function: send_reply */
/* Usage : send_reply (reply_buf, */
/* reply_bytes */
/* Parameters: reply_buf INPUT */
/* reply_bytes INPUT */
/*-------------------------------------------------------------------------*/
/* Send a reply to the request read from $RECEIVE. */
/***************************************************************************/
void send_reply (char * reply_buf,
int reply_bytes)
{
int bytes_replied;
bytes_replied = reply (reply_buf,
reply_bytes);
if (bytes_replied < 0)
{
printf ("Error in sending REPLY\n");
exit (EXIT_FAILURE);
}
} /* end send_reply */
Password Server Database
The following is a TACL macro that creates the two SQL tables, MTPWTABL and
MSPWTABL, required by the password server example provided in the file EXPSWC1
on the OSI/MHS installation subvolume.
The source for this macro is provided in the file EXPSWTL1 on the OSI/MHS
installation subvolume.
?TACL MACRO
#FRAME
#PUSH libvol sql_catalog outfile proc_status pws_vol
#SET libvol $data1
#SET sql_catalog [libvol].t5qpwsq