Solstice X.25 9.2 Developer's Guide

6.4.11 N_PVC_DETACH--PVC Detach

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

 struct strbuf ctlb;
 struct strbuf datab;

 struct pvcdetf detach;
 .
 .
 .
 ctlb.len = sizeof(struct pvcdetf);
 ctlb.buf = (char *)detach;

 datab.len = cudlen;
 datab.buf = cud;

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

N_PVC_DETACH is used when an application wants to detach from a PVC. This allows the use of a stream to be changed. The control part of the PVC Detach is defined by the pvcdetf structure. The data part of the message contains any call user data. The synopsis shows a putmsg. Example 6-1 shows how a getmsg can be constructed.

The pvcdetf structure is shown below:

struct pvcdetf {
 	unsigned char xl_type; /* Always XL_CTL */
 	unsigned char xl_command; /* Always N_PVC_DETACH */
 	int reason_code; /* Reports why */
 };

This structure has the following member:

Table 6-14 Listen Cancel Command/Response Parameters

Member 

Description 

reason_code

The reason for the detach, or a code indicating that a previous PVC Detach was successful.  


Note -

The PVC Detach message is acknowledged to the user by returning another PVC Detach message.