OSI/MHS Management Programming Manual
Examples
OSI/MHS Management Programming Manual—424824-001
C-35
Example in C
 (char *)&tkn_ssid_buf);
 }
 if (!spi_status &&
 strcmp ((char *)&tkn_ssid_buf.u_z_filler.z_owner,
 ZSPI_VAL_TANDEM) == 0 &&
 tkn_ssid_buf.z_number == ZSPI_SSN_ZMHS &&
 tkn_ssid_buf.z_version == ZMHS_VAL_VERSION &&
 tkn_command == PASSW_CMD &&
 tkn_hdrtype == ZSPI_VAL_CMDHDR)
 {
 return (TRUE);
 }
 return (FALSE);
} /* end valid_spi_request */
/***************************************************************************/
/* Function: process_spi_request */
/* Usage : process_spi_request (req_buf) */
/* Parameters: req_buf INPUT */
/*-------------------------------------------------------------------------*/
/* This procedure extracts the PASSW_SERVICE token and, depending on its */
/* value, calls the appropriate routines to process the request. */
/* If there is an error in obtaining the PASSW_SERVICE token, it writes */
/* an error message in the STDOUT file and sends an error response. */
/***************************************************************************/
void process_spi_request (char *req_buf)
{
 short *req_buf_s = (short *)req_buf;
 int error;
 zmhs_ddl_passw_service_def passw_service;
 zmhs_ddl_passw_command_def passw_command;
 error = SSGET (req_buf_s,
 (short *)&zmhs_map_passw_service,
 (char *)&passw_service);
 if (error)
 {
 printf ("SSGET procedure error - %d\n", error);
 send_password_response (PASSW_ERROR_RSP, NULL);
 return;
 }
 error = SSGET (req_buf_s,
 (short *)&zmhs_map_passw_command,
 (char *)&passw_command);
 if (error)
 {
 printf ("SSGET procedure error - %d\n", error);
 send_password_response (PASSW_ERROR_RSP, NULL);
 return;
 }
 switch (passw_service.zvalue)
 {
 case ZMHS_VAL_MTA_BIND_AUTHEN :
 {
 process_mta_request (passw_command.zvalue, req_buf);
 break;
 } /* case ZMHS_VAL_MTA_BIND_AUTHEN */
 case ZMHS_VAL_MS_BIND_AUTHEN :










