#include <stream.h> #include <netx25/x25_proto.h > struct strbuf ctlb; struct strbuf datab; struct xedataf edata; char data[MAX_LENGTH]; . . . ctlb.len = sizeof(struct xedataf); ctlb.buf = (char *)edata; datab.len = cudlen; datab.buf = cud; putmsg(x25_fd, &ctlb, &datab, 0);
N_EData is used when expedited data, carried by an X.25 Interrupt packet, crosses the X.25 interface. The example shows a putmsg. Example 6-1 shows how a getmsg can be constructed. The control part of the Interrupt packet is defined by the xedataf structure. The data part of the message contains the user data. The expedited data is a confirmed primitive and must be acknowledged (see "6.4.8 N_EAck--Expedited Data Acknowledgement") before another expedited data unit can be requested or indicated.
The xedataf structure is shown below:
struct xedataf { unsigned char xl_type; /* Always XL_DAT */ unsigned char xl_command; /* Always N_EData */ };