OSI/MHS Management Programming Manual
Examples
OSI/MHS Management Programming Manual—424824-001
C-38
Example in C
} /* end process_mta_request */
/***************************************************************************/
/* Function: process_ms_add_appl */
/* Usage : process_ms_add_appl (req_buf) */
/* Parameters: req_buf INPUT */
/*-------------------------------------------------------------------------*/
/* Process the ADD APPL request from the MHSMGR. Extract the attributes */
/* from the request, and call add_mspwtabl_row to add the row in MSPWTABL. */
/* If all goes well, issue an OK response, else send an error response. */
/* Tokens: */
/* ZMHS_MAP_APPL_NAME Required */
/* ZMHS_MAP_PASSW Required */
/* ZMHS_MAP_APPL_ORNAME Required */
/* ZMHS_MAP_UA_OSI_ADDRESS Optional */
/***************************************************************************/
void process_ms_add_appl (char *req_buf)
{
short *req_buf_s = (short *)req_buf;
int error;
zmhs_ddl_appl_name_def appl_name;
zmhs_ddl_passw_def passw;
zmhs_ddl_appl_orname_def appl_orname;
zmhs_ddl_ua_osi_address_def ua_osi_address;
error = SSGET (req_buf_s,
(short *)&zmhs_map_appl_name,
(char *)&appl_name);
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,
(char *)&passw);
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_appl_orname,
(char *)&appl_orname);
if (error)
{
printf ("SSGET procedure error - %d\n", error);
send_password_response (PASSW_ERROR_RSP, NULL);
return;
}
/* If OSI address is not present, set the zlength fields to -1
* This is used to indicate to add_ms_pwtabl_row that these
* fields are not present
*/
error = SSGET (req_buf_s,
(short *)&zmhs_map_ua_osi_address,
(char *)&ua_osi_address);
if (error == TKN_NOT_PRESENT_ERROR)
{
error = 0;