![]() |
![]() |
|
|
![]() |
![]() |
X25/9000: X.25/9000 Programmer's Guide > Chapter 3 Establishing and
Terminating a Socket Connection![]() Controlling Call Acceptance |
|
The server process can control the acceptance of incoming CALL REQUESTs. How call acceptance operates is controlled through the use of ioctl(X25_CALL_ACPT_APPROVAL) and ioctl(X25_SEND_CALL_ACEPT) calls. The steps required for controlling call acceptance are shown in the following table. Table 3-1 Controlling Call Acceptance when Establishing an SVC
The ioctl(X25_CALL_ACPT_APPROVAL) call is used to instruct X.25 not to automatically send the CALL ACCEPTED packet. For a listen socket, the ioctl(X25_CALL_ACPT_APPROVAL) call should be implemented before the listen() call. If the ioctl() call is issued after the listen() call there is a risk that incoming calls might be automatically accepted during the brief delay that occurs between the listen() and accept() calls. The accept() still returns a socket descriptor connected to the incoming SVC, but no packets are sent.
When the ioctl(X25_SEND_CALL_ACEPT) call is issued on an SVC socket it causes a CALL ACCEPTED packet to be transmitted. The two ioctl() call acceptance calls are described below. The ioctl(X25_CALL_ACPT_APPROVAL) call allows applications to screen incoming calls. When the call is issued for a given listen() socket, a new accept() socket is still created whenever a valid call comes in, but no data can be sent or received on the new socket until an ioctl(X25_SEND_CALL_ACPT) call is issued on the new socket. This feature must be set if:
If the application does not want to accept the call, the circuit can be cleared with the close() call. The ioctl(X25_SEND_CALL_ACPT) call is described below. Once the ioctl(X25_CALL_ACPT_APPROVAL) is enabled, it cannot be turned off, unless the listen socket is closed and the socket(), bind(), and listen() calls are repeated. The ioctl(X25_CALL_ACPT_APPROVAL) call and its parameters are described below.
sdA socket descriptor for a listen socket that has no accept() pending on it. X25_CALL_ACPT_APPROVALThe definition for the request. 0A dummy variable used because ioctl(X25_CALL_ACPT_APPROVAL) does not use any arguments. The ioctl(X25_SEND_CALL_ACEPT) call causes X.25 (level 3) to send a CALL ACCEPTED packet. The call is executed on a socket descriptor returned from an accept() call. The listen socket on which the accept() call was issued must have previously had an ioctl(X25_CALL_APPROVAL) issued on it. The ioctl(X25_SEND_CALL_ACEPT) causes a CALL ACCEPTED packet to be sent on the SVC. If the application determines that the call should not be accepted, the call can be rejected with a CLEAR packet by calling close() or shutdown() on the socket descriptor. The application may specify D bit usage, facilities, and call user data to be placed in the CALL ACCEPTED packet. The ioctl(X25_SEND_TYPE), ioctl(X25_WR_USER_DATA), and ioctl(X25_WR_FACILITIES) calls control these functions. They must be issued prior to accepting the call with the ioctl(X25_SEND_CALL_ACEPT). The ioctl(X25_SEND_TYPE) is described in Chapter 4 “ Sending and Receiving Data”, the ioctl(X25_WR_USER_DATA) is described in Chapter 5 “ Receiving and Transmitting Out-of-Band Information”, and the ioctl(X25_WR_FACILITIES) is described in Chapter 6 “Extended Features”. The ioctl(X25_SEND_CALL_ACEPT) call and its parameters are described below.
sdA socket descriptor for an SVC socket. Is returned during an accept() call. X25_SEND_CALL_ACEPTThe definition for the request. 0A dummy variable used because X25_SEND_CALL_ACEPT does not use any arguments. |
![]() |
||
![]() |
![]() |
![]() |
|||||||||
|