X.25 Incoming Call Control

Introduction

The X.25 server daemon, x25daemon, links together X.25 modules and drivers. It also listens for incoming calls on the X.25 links, and disposes of them in accordance with the table entries in /etc/x25incalls. Applications invoked by x25daemon use the X.25 library application program interface (API).


How the x25daemon works

When a call from the network arrives, the daemon examines the Call User Data (CUD), the subnet address (SNA), and the Calling address (CA) fields. Based on the contents of these fields, the daemon disposes of the call as defined by /etc/x25incalls. The contents of the Call User Data, subnet Address, and the Calling Address fields are referred to as the call identification or Call ID.

The daemon reads /etc/x25incalls when it starts, and every 5 minutes after that. It also reads the file before processing each incoming call.

The daemon may do one of the following with a call:

The following sections describe how to build /etc/x25incalls, and the kind of control the program exerts over incoming calls.


x25incalls File Description

The x25incalls file consists of comment lines and call ID lines. Comment lines start with #. All other lines are call ID lines. If the daemon detects any errors in the file, it reports them immediately on stderr and exits. A valid call identification line has four colon separated fields followed by a line feed. The fields are:
Call ID : Disposition : reverse : function

Call ID

Call ID is coded as some combination of Call User Data, subnet Address, and Calling Address, separated by commas. If more than one entry is found in the Call ID, then all conditions must be true to select a call. For example, the entry:
SNA=03,CA=12345678
would only match calls that have both a subnet Address of "03" and a Calling Address of "12345678". Note that the subnet Address is part of the Called Address as controlled by called_length.

Binary Values in the Call ID

Binary values in Call User Data may be specified as a string of numeric decimal constants preceded by \. For example, the standard ITI call user data begins with a byte containing a binary 1, followed by 3 null bytes (1 0 0 0). This may be specified as \1\0\0\0. All digits after a `\' are considered to be part of a decimal constant less than 255. Therefore the daemon treats \1000 as 1000, which is greater than 255 and causes an error exit. \100 on the other hand, is valid and is taken as decimal 100. Any non-digit ends the number and is processed as the next ASCII byte. For example, \1\0\0\0B would match a Call User Data field that contains binary one followed by 3 zeros, followed by the letter B.

Wild Card Characters in the Call ID

The data field of Call ID strings may contain '?' characters to match any legal character for the field. For example, the Call ID "SNA=1?1" will match subnet Addresses of 101, 111, 121, 131, and so on up to 191.

Using ANY as a Call ID

The daemon also recognizes the special Call ID, ANY. This specifies the action to take on all unrecognized Call IDs. If there is no entry for ANY, then x25daemon clears all unrecognized incoming calls with a diagnostic code of 0xB0.

Disposition

The disposition field may have one of: PASS or CLEAR:

Reverse

The reverse field must be either YES or NO. If the reverse field is NO, the daemon clears calls which otherwise match the call ID but request reverse charging.

Function

The function field contains the complete path name and calling sequence to the program that will handle this call. The program will be called by x25daemon just like it would be started from a UNIX command line. A few parameters may be passed to the application that are determined at call request time: Comments (that is, text beginning with a "#") may also be included. Characters after the # through the end of the line are not interpreted by routines that use this file.


Using the Daemon to Enhance System Security

Selecting Calls Based on Calling Address

If you know the X.121 address of all the locations which might call your system, you can identify each of them in /etc/x25incalls, and specify CLEAR for the ANY Call ID. Since the daemon matches each call with a table entry, your system never connects to locations it has not been programmed to recognize.

Checking for Passwords in Call User Data

If you have a large terminal population, and do not want your UNIX system to spend time reading and searching /etc/x25incalls, you can use password protection instead of specific addresses. The password approach is the only one you can use if your terminals are using public PADs, as their network address varies from call to call under those circumstances.

To use password protection, you simply use CUD=\1\0\0\0SomeWord in the Call ID field for the passwords you wish to authorize. Note that the protocol selection field of the Call User Data precedes the Call User Data that a user might supply. In the example above, although an X.3, X.28, X.29 PAD user only supplies SomeWord, the PAD in use has prepended the four-byte string that identifies the call as one from an X.3, X.28, X.29 PAD device.


x25incalls File Sample

#
#        Lines in this file consist of 4 fields separated by colons.
#
#        call_id: disposition: reverse: function
#
#  The ANY entry.  We are accepting all unrecognized calls as
#  possible login attempts.  Ensure that these people
#  pay for their traffic charges and clear any calls with reverse
#  charging specified.
#
ANY:PASS:NO:/etc/padd -d $dev -v $index
#
#  Check for a Sub network address of 03.  If we find it, then pass
#  it to a local switching function that makes a call out on link 1.
#  Link 1 is a dedicated link to a secondary in house machine.
#  We will not accept reverse charging calls here.
#
SNA=03:PASS:NO:/usr/lbin/switchout $dev
#
#  If the call user data contains "S", pass it to a data sink program.
#
CUD=\1\0\0\0S:PASS:YES:/usr/lib/x25/sink $dev $netid $index
#
#  Accounting has discovered that the user at net address 10002000 is
#  a malicious hacker.  Clear all calls from this address.
#
CA=10002000:CLEAR::
#

Revision 1.1 (January 2002)

Copyright © 1997-2002 The Software Group Limited. All Rights Reserved.
® Netcom is a registered trademark of The Software Group Limited.