Since facilities can be read only one at a time, the user needs a way to determine which facilities are present. Solstice X.25 provides the following mechanism for doing this.
The user can read a bit mask that has one bit reserved for each of the facilities described above. This is read as:
u_int fmask; f.type = T_FACILITIES; error = ioctl(s, X25_GET_FACILITY, &f); fmask = f.f_facilities;
The following mask bits are defined:
F_REVERSE_CHARGE /* reverse charging */ F_FAST_SELECT_TYPE /* fast select */ F_PACKET_SIZE /* packet size */ F_WINDOW_SIZE /* window size */ F_THROUGHPUT /* throughput */ F_MIN_THRU_CLASS /* minimum throughput class */ F_CUG /* closed user group selection */ F_RPOA /* ROPA transit network */ F_TR_DELAY /* network transit delay */ F_ETE_TR_DELAY /* end to end transit delay */ F_NUI /* network user identification */ F_CHARGE_REQ /* charging information request */ F_CHARGE_MU /* charging information, monetary unit */ F_CHARGE_SEG /* charging information, segment */ F_CHARGE_DUR /* charging information, call duration */ F_LINE_ADDR_MOD /* called line address modified notification */ F_CALL_REDIR /* call redirection notification */ F_EXPEDITED /* expedited data negotiation */ F_CALLED_AEF /* called AEF */ F_CALLING_AEF /* calling AEF */ F_PRIVATE /* non-X.25 facilities */
For example, to determine if the Call Redirection facility has been received, the following segment of code could be used:
if ((fmask & F_CALL_REDIR) != 0) { /* * Read its value. */ CALL_REDIR call_redir; f.type = T_CALL_REDIR; error = ioctl(s, X25_GET_FACILITY, &f); call_redir = f.f_call_redir; }