Solstice X.25 9.2 Developer's Guide

6.4.5 N_Data--Data

Synopsis
#include <stream.h>
 #include <netx25/x25_proto.h >

 struct strbuf ctlb;
 struct strbuf datab;

 struct xdataf control;
 char          data[MAX_LENGTH];
 .
 .
 .
 ctlb.len = sizeof(struct xdataf);
 ctlb.buf = (char *)control;

 datab.len = MAX_LENGTH;
 datab.buf = data;

 putmsg(x25_fd, &ctlb, &datab, 0);
Description

N_Data is used to transfer data across the X.25 interface. The synopsis shows a putmsg. Example 6-1 shows how a getmsg can be constructed. The control part of the Data packet is defined by the xdataf structure. The data part of the message contains the user data.

The xdataf structure is shown below:

struct xdataf {
 	unsigned char xl_type; /* Always XL_DAT */
 	unsigned char xl_command; /* Always N_Data */
 	unsigned char More; /* Set when more data is required
                            to complete the nsdu */
 	unsigned char setDbit, /* Set when data carries X.25 D-bit */
 	unsigned char setQbit; /* Set when data carries X.25 Q-bit */
 }; 

The members used by xdataf are.

Table 6-10 Data Message

Member 

Description 

More

Shows whether there is more of this network service data unit to be received/sent. 

setQbit

Requests or indicates that the Q-bit is set when user data is transmitted/received. The Q-bit indicates that the data is intended for a device attached to the DTE and not for the DTE itself. 

setDbit

Requests or indicates that the D-bit is set when user data is transmitted/received. The D-bit requests end-to-end acknowledgement. 


Note -

No acknowledgement for this data is given to, or expected from, the application unless the D-bit is set and application-to-application Receipt Confirmation is being used.