Requests that NPI binds a user stream to the X.25 protocol layers for the calling application. For X.25 SVCs, this gives the details of what incoming calls should be routed to the application. For X.25 PVCs, it gives details of what logical channel number to use.
This primitive consists of one M_PROTO message block with the following structure:
typedef struct { ulong PRIM_type; ulong ADDR_length; ulong ADDR_offset; ulong CONIND_number; ulong BIND_flags; ulong PROTOID_length; ulong PROTOID_offset; } N_bind_req_t;
The N_BIND_REQ primitive requests that a network address be associated with a stream. It gives the maximum number of connect indications that can be outstanding for the particular application. It also indicates if the stream is a listening stream or a non-listening stream. A listening stream only receives connect indications (N_CONN_IND), and a non-listening stream either sends connect responses (N_CONN_RES) or connect requests (N_CONN_REQ). Bind requests for listening streams should use the PROTOID field to specify the details of incoming calls that should be listened for.
If it is desired that a stream bound as a non-listening stream issue both N_CONN_REQ and N_CONN_RES primitives, it is necessary to do two binds. One bind allows N_CONN_REQ primitives to be sent; then an N_UNBIND_REQ primitive followed by an N_BIND_REQ primitive that binds the stream for sending the N_CONN_RES primitive is issued.
A sample of NPI code is included with the X.25 product.
Note: The address must be a null-terminated string, and the null character is not counted as part of the length field of the M_PROTO message.
N_BIND_REQ SVC Address Formats | |||
Byte # | Represents | Value | Format |
1 | line number | 0-255 | Binary |
2 | address prefix | 0 for X.121 | ASCII |
3 - on | address itself | X.121 address | ASCII |
N_BIND_REQ PVC Address Formats | |||
Byte # | Represents | Value | Format |
1 | line number | 0-255 | Binary |
2 | address prefix | P | ASCII |
3 - on | logical channel # | 0-4095 | ASCII |
Note: At a given time, not all 4096 LCNs are available. The range must be that which is configured for this X.25 port.
The line number can be obtained several ways. The lsx25 command lists the logical port number for each port, which is the line number. Another way is to use the lsattr command as follows:
lsattr -E -l portname -a port_num
The value to use for the line number is the port_num field. A third option is to use the odm_get_obj subroutine. An example of this code can be found in the sample code directory for NPI.
CONIND_number | Indicates the requested number of outstanding connect indications for the specified protocol address. This number should be set to zero if a non-listening stream is desired or greater than zero if a listening stream is desired. A listening stream can also be a DEFAULT_LISTENER, which means that it will accept connect indications (N_CONN_IND) for any network address on any port with any call user data. |
BIND_flags | Specifies one or more of the following: |
PROTOID_length | Specifies the length, in bytes, of the protocol IDs to be bound to the stream. |
PROTOID_offset | Specifies where the protocol ID begins. The parameter value is an offset from the beginning of the M_PROTO block.
The PROTO_id field gives a pattern to match to the call user data (CUD) of incoming X.25 packets. It must be a null-terminated ASCII string where only digits (0-9), hex digits (A-F), "?" and "*" are allowed. Note that the length of this string, including the null character, cannot exceed 34 bytes. Following are some examples of how the matching for the PROTO_id works. |
The NS provider generates one of the following acknowledgments upon receipt of the N_BIND_REQ primitive:
Successful | The NS provider sends the N_BIND_ACK primitive. |
Unsuccessful | Non-fatal errors are indicated by the N_ERROR_ACK primitive. |
The applicable non-fatal errors are as follows:
The N_BIND_REQ primitive is part of X.25 licensed program.