OSI/MHS Management Programming Manual
Examples
OSI/MHS Management Programming Manual—424824-001
C-31
Example in C
•
Extracts local and remote MTA names, and optional passwords, from the password
database (MTPWTABL SQL table), and processes SPI requests as follows:
•
Writes an error message, if necessary, to a standard output file.
MS Password Server Functions
The example performs the following tasks using the MS password server interface:
•
Opens $RECEIVE to read SPI requests from the MHS manager process and from
the MS process.
•
Reads a SPI request and validates it.
•
If the request is from the MHS manager process, it processes the request as follows,
using the MSPWTABL SQL table:
•
ADD APPL commands
Adds a row to the password database
•
ALTER APPL commands
Obtains old values from the password database and updates the table
•
DELETE APPL commands
Deletes a row from the password database
•
If the request is from the MS process (in response to a request from a UA), it
processes the request as follows, using the MSPWTABL SQL table:
•
MS bind operations
Validates the password and the OSI address of the calling UA. Note that both
local and remote OSI addresses are validated by this example.
•
Register-MS operations
Validates the old password and updates the password database with the new
password. Note that only the change credentials within a register-MS request
are passed to the password server.
•
Sends an error message, if necessary, to a standard output file.
•
Sends a response back to the requester.
Example in C
The source code for this example is provided in the file EXPSWC1 on the OSI/MHS
installation subvolume.
/*
* FILE: EXPSWC1
*
* This is an example password server program.
•
Requests: Extracts the password and sends it in the response.
•
Indications/Confirms: Validates the information and sends a reply.
•
Responses: Supplies the response password.