![]() |
![]() |
|
|
![]() |
![]() |
X25/9000: X.25/9000 Programmer's Guide > Chapter 2 X.25 Addressing![]() Using Wildcard Addressing |
|
Wildcard addresses are used in bind() calls only. They cannot be used in connect() calls. Wildcard addressing allows a single listen socket to connect to incoming calls using a variety of addresses and protocol IDs. The re are three types of wildcard addressing. The one which is implemented depends on the field in the x25addrstr structure that is being used. When an incoming CALL REQUEST packet is received, the x25addrstr structure fields are checked in the following order: x25ifname, x25_host and then x25pid. The x25ifname[] field has only one form of wildcard addressing. If you specify the null string ("\0"), the specified address will match the X.121 address of any interface connected to your system. If you specify an inter face name, only calls from that one interface will match. A wildcard address in the x25_host[] field may be the null string or use special wildcard characters. As described above, the null string will match only the X.121 address of the interface on the receiving end, but not the sub address. The valid wildcard characters are the question mark ("?"), and the asterisk ("*"). These characters may be used in combination with the decimal digits normally specified in this field. When they are specified in the x25_host field and are matched with an incoming call's called address field they have the properties described in table below. Table 2-1 Wildcard Characters
The table below illustrates the various possibilities of matching an non- matching addresses for a given number using wildcard characters. Table 2-2 Wildcard Address Matching for x25_host
The server specifies the protocol ID for its listen socket in the x25pid field of the x25addrstr structure. The protocol ID is part of the call user data field in the CALL REQUEST packet. This field is added (ANDed) with the mask specified in the ioctl(X25_WR_MASK_DATA). The x25pid field and the mask specified in the ioctl(X25_WR_MASK_DATA) can be combined to enable a certain degree of wildcard addressing. The protocol ID masking match works as follows:
Use this wildcard method if the incoming protocol ID you need isn't a whole number of bytes, or there are bytes within the field that are not part of the protocol ID. For example, some systems place a length byte at the beginning of the call user data field, which should be ignored in protocol ID matching. The bit-by-bit comparison is described in the following table: Table 2-3 x25pid and x25_mask Usage
The syntax for the ioctl(X25_WR_MASK_DATA) system call and its parameters are described below.
sdA socket descriptor for a listen socket. X25_WR_MASK_ DATAIndicates the type of ioctl() being performed. If the X25_WR_MASK_DATA value or x25_mask_len value is set to 0, the ioctl() call returns no error and an empty mask is used. This has the same effect as if the call were not made. maskIndicates the mask to be ANDed with the protocol ID specified in the CALL REQUEST packet. The x25_mask_len field indicates the length of the mask, and the x25_mask indicates the mask to be used. |
![]() |
||
![]() |
![]() |
![]() |
|||||||||
|