• No results found

ISO 8583 Protocol

The ISO 8583 Protocol Engine interfaces to the programmer defined validation function used to determine if an appropriate response was received. This engine interfaces to the programmer-defined communication function used to transmit and receive request and response messages. It processes reversals as specified in the ISO 8583 standard.

The PIP Engine requires the ISO 8583 Protocol Engine, but the ISO 8583 Protocol Engine does not require the PIP Engine. It does, however, require the ISO 8583 Message Engine.

Although this engine was written to support the PIP Engine and the ISO 8583 process, it could be used to interface to any engine that uses ISO 8583 packets for processing. This section treats the ISO 8583 Protocol Engine as a generic module. See PIP Engine for specific implementation of the ISO 8583 Protocol Engine

This engine can only be used with Verix eVo ACT, (VPN P006-212-02), for Verix eVo based terminals.

ISO 8583

Protocol

Engine Data

Structure

The ISO 8583 Protocol Engine requires a data structure to provide information and application data variables. By using a structure to contain this information, the interface to the ISO 8583 Protocol Engine is simplified. The protocol 8583 data structure is defined in the PROT8583.H header file.

Prototype typedef struct c8583dat {

field_struct *p_fld_table; int *comm_handle;

unsigned comm_timeout; unsigned wait_for_carrier; unsigned char *map;

int (* validation) (void *, int); void *v_parms;

unsigned v_parms_size;

int (* transceiver) (int, int, unsigned char *, unsigned, unsigned char *, unsigned, unsigned, unsigned);

ISO 8583 PROTOCOL ENGINE

ISO 8583 Protocol Engine Data Structure

unsigned char *transmit; unsigned int transmit_size; unsigned transmit_limit; unsigned char *receive; unsigned receive_size; unsigned receive_limit; unsigned char *reversal; unsigned reversal_size; unsigned reversal_limit; unsigned char *base_name; unsigned char rev_msg_id[5]; int state;

} COMM_8583_DATA;

Parameters

p_fld_table The ISO 8583 Protocol Engine calls the ISO 8583 Message Engine to assemble and disassemble messages for each transaction. The p_fld_table member is a pointer to the applications field table that contains all the required information. comm_handle A pointer to the communications device. This handle is passed to

the communications routine as required.

comm_timeout A time-out value specifying the length of time to wait for a response from the host. This parameter is passed to the communications routine as required.

wait_for_carrier A time-out value passed to the communications routine to specify the period of time to wait if the carrier is not present. In applications where the call to the host is initiated early in the transaction, the carrier may already be present when the message is available for transmission. In other cases, it is necessary for the communications routine to wait for carrier to indicate the connection to the host is complete.

map A pointer to the completed bitmap for the transaction. This bitmap can be constructed by the application in various ways or at various times, including as a file.

validation A function pointer called after receiving a response to a request message. The function should return a 0 if the response is valid, or -1 to -14 if the validation routine fails. Any positive return value is taken as a request to wait for a new response packet. The return value is, therefore, the number of seconds to wait for the next response. The #define RETRY_CURRENT_TIMEOUT may be returned to request a new response packet using the current time-out value.

Two parameters are passed to this function: a pointer to the validation structure, and the result of an internal validation of the TPDU and response message ID by the Protocol 8583 Engine (refer to check_8583_tpdu_msg_id() for a list of valid values for this parameter).

ISO 8583 PROTOCOL ENGINE ISO 8583 Protocol Engine Data Structure

v_parms v_parms_size

A pointer to the application validation structure, v_parms_size specifies the size of that structure. By using a structure to contain the validation parameters, parsing is reduced and comparisons are easier.

For AMEX transactions, the response message is validated by comparing the amount, systems trace number, and terminal ID to the request message. During disassembly, some application variables are overwritten (such as, the transaction amount) by the field information in the response.

Note: To preserve this information, the validation structure is

created to hold the values needed to validate the response.

v_parms_size builds the reversal and advice files, and is widely used throughout the ISO 8583 Protocols Engine.

v_parms_size must be set to include the RRN field. It uses the space to manage the RRN under time-out conditions.

transceiver A function pointer used as the entry point to the communications routine. This routine is called to send or receive any messages. transmit

transmit_size transmit_limit

These three parameters define the buffer used to contain out- going messages. The buffer must be large enough to contain the largest transmit message and the size of the validation structure. transmit_size is the size of the message to send.

transmit_limit is the maximum size of the buffer. receive

receive_size receive_limit

These three parameters define the buffer used to contain in- bound messages. The buffer must be large enough to contain the largest message that will be received. receive_size is the size of the message to be received in the buffer.

receive_limit is the maximum size of the buffer. reversal

reversal_size reversal_limit

The ISO 8583 Protocol Engine provides reversal processing. These three parameters process reversal requests and must be identical to the transmit buffer requirements (size and limit). base_name String used to construct a separate reversal file. The file

extension .REV is appended to base_name when the reversal is created. This allows the ISO 8583 Protocol Engine to support different hosts and separate reversal files.

rev_msg_id[5] Like all other ISO 8583 messages, reversals require a message ID. The ISO 8583 Protocol Engine must be able to create a reversal for any transaction at any time. rev_msg_id[ ] must be loaded with the appropriate reversal message ID for the host.

ISO 8583 PROTOCOL ENGINE

ISO 8583 Protocol Engine Data Structure

state Flag to determine the processing state of the ISO 8583 Protocol Engine. Uses TRAN_REQ (transaction request), REV_REQ (reversal request), or NEW_REV_REQ (new reversal), as defined in PROT8583.H. The state is included in the control structure so that the application can determine the current transaction being processed. This is useful in controlling the types of messages displayed during communications. The application treats this as a read-only parameter.

ISO 8583 PROTOCOL ENGINE Programmer-Defined Functions

Programmer-