HP X.25/9000 Programmer's Guide

Chapter 2 21
X.25 Addressing
Using Wildcard Addressing
The protocol ID masking match works as follows:
1. The first byte from the CALL INDICATION packet’s call user data
field is “masked” (that is, logically ANDed bit-by-bit) with the first
byte of the mask specified with the ioctl(X25_WR_MASK_DATA).
2. The result is compared to the value specified in the first byte of the
x25pid
field in the x25addrstr structure specified in the bind() call.
3. If the result is unequal, the comparison fails. If equal, the comparison
continues with the next byte of each field until a mismatch occurs or
the number of bytes in the bind address’s
x25_pidlen
field has been
compared.
Use this wildcard method if the incoming protocol ID you need isn’t a
whole number of bytes, or there are bits 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:
Syntax for ioctl (X25_WR_MASK_DATA)
The syntax for the ioctl(X25_WR_MASK_DATA) system call and its
parameters are described below.
#include <x25/x25ioctls.h>
#include <x25/x25.h>
int err;
/* DEFINE X25_MAX_PIDLEN 8
* struct x25_mask_data {
Table 2-3 Using x25pid and x25_mask
Call User Data Bit x25_mask Data Bit x25pid Data Bit
0 or 1 0 0 always matches
0 or 1 0 1 always fails
0 1 0 matches
0 1 1 fails
1 1 1 matches
1 1 0 fails
36960-90061.bk Page 21 Friday, November 10, 2000 3:42 PM