Solstice X.25 9.2 Developer's Guide

12.7.2.13 Charging Information

By setting f.type to T_CHARGE_REQ as specified above you make available the following read-only facilities. The facility types are T_CHARGE_MU, T_CHARGE_SEG, and T_CHARGE_DUR. For example, the Charging Information (monetary unit) is read as follows:

typedef struct charge_info_s {
    u_char   charge_len;
 #define MAX_CHARGE_INFO   64
    u_char   charge_data[MAX_CHARGE_INFO];
 } CHARGE_INFO;

 CHARGE_INFO charge_mu;
 f.type = T_CHARGE_MU;
 error = ioctl(s, X25_GET_FACILITY, &f);
 charge_mu = f.f_charge_mu; 

The T_CHARGE_SEG and T_CHARGE_DUR facilities are read in a way similar to the T_CHARGE_MU example above; that is, by using T_CHARGE_SEG or T_CHARGE_DUR for the f.type value, and using f_charge_seg or f_charge_dur in place of f_charge_mu.

The maximum length for the charging information facility permitted by Solstice X.25 is 64 (MAX_CHARGE_INFO). This facility should be read after the call is cleared, but before the socket is closed, since it is received in the Clear Request or Clear Confirm packets.